Question
1
Replies
53
Views
Posted: September 11, 2020
Last activity: September 14, 2020
Is there any ootb function to validate "2020-05-21T18:30:00Z" datetime format and convert to pega DateTime
Is there any ootb function to validate "2020-05-21T18:30:00Z" date format and convert to pega DateTime
Not OOTB that I have found. Please review this discussion for some options on how to do this
https://collaborate.pega.com/question/how-convert-string-date-format
As you have a timestamp that includes a timezone reference then you would be OK to use the SimpleDateFormat class. Either way I would recommend implementing this as your own Function rule and require that the date/time format of the input string be passed in as a parameter to allow your Function to be reusable elsewhere in your application if different input formats are used.
At the point you invoke the Java parse function, if a Java exception is thrown then the input string is not a valid timestamp for the format you are expecting.