Michael Fede (MichaelF4652)
Raytheon Technologies

Raytheon Technologies
MichaelF4652 Member since 2016 17 posts
Raytheon Technologies
Posted: June 10, 2020
Last activity: May 4, 2021
Posted: 10 Jun 2020 16:30 EDT
Last activity: 4 May 2021 11:37 EDT

Convert ISO DateTime to Pega DateTime

There are other posts on this subject but they all seem closed without an answer. 

Is there a function to easily convert an ISO DateTime string to a Pega DateTime? Many answers that I've seen posted say to use the FormatDateTime function. While that can be used to format a Pega DateTime to the ISO format, it does not work if you provide an ISO formatted date as input.

Here's an example of formatting a Pega DateTime as ISO:

FormatDateTime(CurrentDateTime(), "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", "GMT", null)

Which gives output that looks like this: 


Using the Expression builder, if I enter "2020-06-10T20:38:36.700Z" as the first argument to FormatDateTime, I get a blank result.

I've also tried the parseDateTimeStamp but that gives me an error message in the expression builder. 

Right now we're getting past this using a series of replaceAll functions but it really seems like there should be a better way to do this.

This is a problem every time we get date values back when calling REST services.


Pega Platform 8.3.2 Data Integration