cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Date Parse a String

matt_bostrom
New Contributor II

I have a string in the format = โ€œ4-Jul-2017โ€ variable is called โ€œPostingPeriodFormattedโ€

When I throw on a dateparse method in the mapper like so:

Date.parse($PostingPeriodFormatted, โ€œyyyy MM ddโ€)

I get the following error: Failure: The date format string is invalid, Reason: Invalid format: โ€œ4-Jul-2017โ€ is malformed at โ€œ-Jul-2017โ€, Resolution: Please provide a format string that follows the Java SimpleDateFormat syntax

What could be wrong?

3 REPLIES 3

matt_bostrom
New Contributor II

i just realized the date parse format is meant to be the format its currently in not what i want to parse it to! when i switched it to dd-MMM-yyyy it works

however does anyone recommend the best way to transform this value coming from a DB: โ€œJul 4 2017 9:03PMโ€ to 2017-07-04T09:03:00?

Since you are losing the PM designator, wouldnโ€™t the time be 2017-07-04T21:03:00?

Iโ€™m conferring with Dev on this right now, so wanted to make sure we parse it correctly.


Diane Miller
Community Manager