Skip to main content

I have two Assign Datetime functions running one after another, with the same format, and dates in the same format, but for some reason one of them isnt working:

First One:

 

Second One:
 

 

this is the format of the dates:
25 Aug 2024 19:58
03 Sep 2024 06:30

I tried to replicate your issue, but I had no problems parsing either one of them.

I'm guessing that your variables might contain characters that look like white spaces but aren't.

You can use something like this to normalize your string before parsing.

It wouldn't hurt to use the "trim” function on the Datetime: Assign action. 

 

Let me know if that fixed your issue.


That’s an interesting question, Raphael Brito !

I think the following community members may be able to help 

@ChanduMohammad 

@Zaid Chougle 

@Tamil Arasu10 

@Paul Hawkins 

@Padmakumar 


Hi ​@Raphael Brito,

✅ Common Causes & Fixes

1. Input Format Mismatch

Even a small difference in the input string (like an extra space, missing zero, or wrong separator) can cause parsing to fail.

  • Check: Are both datetime strings exactly in the format you're specifying?
  • Example:
    • Format: MM/dd/yyyy HH🇲🇲ss
    • Valid: 07/15/2025 14:30:00
    • Invalid: 7/15/2025 14:30:00 (missing leading zero)

2. Null or Empty Input

If the second datetime string is empty or null, the action will fail silently or throw an error.

  • Check: Use a Log to File or Message Box before the Assign to confirm the value.

3. Incorrect Locale or Timezone

If your system or bot runner uses a different locale, the datetime format might not match expectations.

  • Fix: Use ISO format (yyyy-MM-dd'T'HH🇲🇲ss) if possible, or explicitly set the locale.

4. Variable Type Confusion

If you're assigning to a variable that was previously used as a string or number, it might not accept a datetime value.

  • Fix: Ensure the target variable is of Datetime type.

5. Trailing Characters

Sometimes hidden characters (like newline \n or tab \t) sneak into the string.

  • Fix: Use String: Trim before assigning.

Reply