Hi,
Is there an OOTB function to convert a datetime text to DateTime object?
The datetime string is of the format - YYYY-MM-DDThh:mm:ss.SSSZ (Example: 2018-07-20T09:09:26.000Z)
TIA
Regards,
Sunil Zacharia
Discussion posts and replies are publicly visible
I would use the datetime function and split your datetime string so you have the necessary properties. That function will return a value of DateTime.
In the past I needed to do a much similar conversion - here's the expression rule I used:
with( local!dateTimeValueArray: split(substitute(substitute(substitute( ri!string, " ", ":" ), "-", ":"), ".", ":"), ":"), if( rule!APN_isEmpty(local!dateTimeValueArray), null(), datetime( local!dateTimeValueArray[1], local!dateTimeValueArray[2], local!dateTimeValueArray[3], index(local!dateTimeValueArray, 4, 0), index(local!dateTimeValueArray, 5, 0), index(local!dateTimeValueArray, 6, 0), index(local!dateTimeValueArray, 7, 0) ) ))
Use the value function to parse text date into a date. see docs.appian.com/.../fnc_text_value.html