Convert datetime 20231219T173725.176 GMT to YYYY-MM-DDTHH:MM:SS±ZZ:ZZ

Is any function available converting DateTime format from 20231219T173725.176 GMT to YYYY-MM-DDTHH:MM:SS±ZZ:ZZ format. (Looking for EST time zone)

Below is the expected format for DateTime:

( “[1]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[\-\+][0-9]{2}:[0-9]{2}$” )


  1. 0-9 ↩︎

Hello @dileepm4794!

You can use the @FormatDateTime function in Pega to convert the datetime format. Here is an example of how you can do it:

@FormatDateTime(“20231219T173725.176 GMT”, “yyyy-MM-dd’T’HH:mm:ssZ”, null, null)

This will convert your datetime to the desired format.

:warning: This is a GenAI-powered tool. All generated answers require validation against the provided references.

References:

https://support.pega.com/question/date-format-conversion

@MarissaRogers thank you for your response.

This is my clipboard TestDateTimeProperty value - 20240119T004300.000 GMT

After using the function @FormatDateTime(“.TestDateTimeProperty”, “yyyy-MM-dd’T’HH:mm:ssZ”, null, null), during runtime, the result value came empty value.

Hi @dileepm4794

Please remove the double quotes around the property name and use the below format to acheive the desired output

FormatDateTime(.TestDateTimeProperty,“yyyy-MM-dd’T’HH:mm:ssZ”,“”,“”)

@SoumyajitB Thank you for the response.

I tried as suggested. the results are.

the value I am getting is 2024-01-08T21:50:00-0500

But I need it in this format 2024-01-08T21:50:00-05:00

Hi@dileepm4794 please use the below format to achieve the desired output.

@DateTime.FormatDateTime(Param.TestDateTimeProperty,“yyyy-MM-dd’T’HH:mm:ssXXX”,“”,“”)