String to Date Parsing Issue

Hello Everyone, I am having an issue with parsing or converting string into date. Input String: 12/3/2018 8:47:32 AM  I am currently using the following function to convert that parseDateTime($Iteratorchemistry_content_1/uc_WorkflowDate,'mm-dd-yyyy hh:mm:ss',empty) But this statement causes all the conversion to get empty Desired Output: 12/3/2018  When I use the following statement, I get run-time error: parseDateTime($Iteratorchemistry_content_1/uc_WorkflowDate,'mm-dd-yyyy I am not sure how to proceed. Could anyone please advise. Thanks a lot in advance. Best Regards, Lidan Zhang
2 answers

To add one change to Tim’s answer, I think you’ll need the letter a at the end of the second argument (which denotes AM/PM), so it would look like this:  parseDateTime($Iteratorchemistry_content_1/uc_WorkflowDate,'mm/d/yyyy hh:mm:ss a',empty)  Without the a, the parse function won’t know if a the time in your example is 8 in the morning or 8 in the evening.  You can also omit the third argument (empty) for brevity.

One more link that documents all possible date formatting characters: 


You should use /d/ instead of -dd-. This is the correct one: parseDateTime($Iteratorchemistry_content_1/uc_WorkflowDate,'mm/d/yyyy hh:mm:ss',empty)

See for the description

See for experimenting with formats