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