Question

8
Replies
442
Views
MichaelF4652 Member since 2016 17 posts
Raytheon Technologies
Posted: June 10, 2020
Last activity: August 6, 2020

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: 

2020-06-10T20:38:36.700Z

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
Share this page LinkedIn