convert String Date Time to Date&Time

Hi @Subramanyam , there are some things to add. The format mask that @nan gave, could well be correct, but as you haven’t told us what the order of month and day is in your date, it could equally begin with M/d or d/M.

A second thing to be aware of is the fact AM/PM are upper case.

Unfortunately the standard Date&Time nodes are case sensitive and whether it is AM/PM or am/pm is “locale dependent”, so you will need to make sure you set the “Locale” on the String to Date&Time node to a locale that accepts the upper case version.

This can be trial/error but as a quick example, with the locale set to en-US, the “a” element of the mask will convert AM/PM but fail am/pm
With the locale set to en-GB, the “a” element will convert am/pm but fail AM/PM

You will hopefully get what you need from the above.

Alternatively, I have a component “Parse Date&Time” which will quickly convert many different date/time strings if you simply tell it the order of the day month and year elements.

More details of that component can be found here:

Additional background info re AM/PM handling and parsing:

5 Likes