Closed
Solved
Convert string "yyyy-MM-dd" to datetime
Hello,
On a data transform, I'm trying to set a field that is a datetime by converting a string in the following format "yyyy-MM-dd".
Any idea to do this ?
Hello AkhilaD9667,
From my understanding FormatDateTime, is a function to convert an existing date time into another format, not to parse a string with a given template into a datetime.
For now I have done the following which use String utils only : toDateTime(replaceAll("2019-12-24"+"T000000.000 GMT","-",""))
So, concate "T000000.000 GMT" to my string then replace - by "" then call toDateTime function which will convert yyyyMMddT000000.000 GMT into a dateime.
I hope to find a better way but at least it's working.