Close popover
Luis Fernando Orellana (Luis Fernando)
Ernst & Young
Pega Software Developer
Ernst & Young
Luis Fernando Member since 2017 16 posts
Ernst & Young
Posted: June 19, 2018
Last activity: June 22, 2018

Setting a Dynamic Timezone (Pega Timezone)

Good afternoon!

So, as the title says, my question is related to setting up dynamically a Timezone inside a HTML rule in PEGA (Or setting up the timezone that PEGA sets when displaying a property, like pxCreateDateTime for example).

The scenario I have is this, I'm doing an HTML rule to export the results of a report to Excel, and inside that there's a piece of JSP code I was using to get the Default TimeZone, which I thought was gonna be the same of PEGA:

final TimeZone tz = TimeZone.getDefault();
String timeZone=tz.getID();

And below this, is how I format the output for the excel (Which, without formatting, just comes out in GMT Timezone, which is the same as the property itself):

DateTimeUtils dtu = ThreadContainer.get().getDateTimeUtils()
String pxCreateDateTime= tools.getStepPage().getString("pxCreateDateTime");
pxCreateDateTime = dtu.formatDateTime(pxCreateDateTime, "MM/dd/yy hh:mma", timeZone, "");
tools.appendString("<td wrap> " + timeZone + " " +pxCreateDateTime + "</td>");

So the thing is that, I see PEGA by default changes the GMT timezone from the property to another timezone (Let's say, server timezone). Is there a way to replicate that behavior? I tried the above approach but it just picks a Default Timezone (Probably specified somewhere, but it's a different timezone than the one in the PEGA report).

If any more clarification is needed, feel free to ask!

Thanks in advance,

- Luis Fernando Orellana

***Edited by Moderator Marissa to update platform capability tags***

User Experience
Moderation Team has archived post