Forum Discussion
Matt,
If you copy the expression from here, it will have different quotations (" "). Try to type the entire expression in the mapper instead of copying it from here. It works.
The quote thing messed me up when I was trying to help someone with an expression on a different thread. If you wrap the expression in preformatted text using , then it won’t change the quote mark.
For example I think this should copy and paste ok:
Date.parse($MODDATE,"yyyyMMdd hhmmss").toLocaleDateTimeString({"format":"yyyy-MM-dd hh:mm:ss"})
- anivtk6 years agoNew Contributor II
Awesome, this worked! Thanks for your quick help.
Note: Inorder to insert that into SQL server I have changed the output to a format SQL server supporst. So the parse function I used is Date.parse($create_time).toLocaleDateTimeString({“format”:“yyyy-MM-dd’T’HH:mm:ss.SSSSSS”})
Thanks again!
- anivtk6 years agoNew Contributor II
I am calling the snapLogic Activity API and its returning the date in the format as “2020-02-21T17:44:19.996000+00:00”
I am trying to store this data into SQL server and SQL server doesn’t accept this data in DateTime data type. I tried to use some simple pare method and it’s still not accepting. Later I used some complex Parse method like below, but its still not working.
Date.parse($create_time,“yyyy-MM-dd’T’HH:mm:ss.SSSSSSX”).toLocaleDateTimeString({“format”:“yyyyMMdd-HHmmss”})
Can someone provide how to parse the data in this format “2020-02-21T17:44:19.996000+00:00” to DateTime which is compatible with SQL server ?
- dmiller6 years agoFormer Employee
I believe you just need:
Date.parse($create_time).toLocaleDateTimeString({"format":"yyyyMMdd-HHmmss"})