I have requirement that i get Unix TimeStamp from external system and i should convert it to GMT format how does pxCreateDateTime has in clipboard. Can any one know about this? Any OOTB function avalable. Please help me.
In the below screenshot from expression builder, Param.UnixTime is the time you mentioned above in seconds. Your time is in milliseconds. I removed last three digits to convert it to seconds.
@VinayLakka125 Create a new function (ex. UnixTimestampToPegaDateTime) with 2 parameters: timeUnix and timeZone with the following code. This will return the Pega date time format.
// Convert the string "timeUnix" to Date
Long d = Long.parseLong(timeUnix, 10);
Date d1 = new Date(d);
// Format to fit in the appropiate PEGA type
// timeZone can be "GMT-5"
return PRDateFormat.format(null, timeZone, PRDateFormat.PEGARULES_INTERNAL_DATETIME, d1);
If you want to get DATE instead of DATETIME use PRDateFormat.PEGARULES_INTERNAL_DATE.