Question

2
Replies
3333
Views
Luis Fernando Member since 2017 16 posts
Rulesware LLC
Posted: 2 years ago
Last activity: 2 years 4 months ago
Closed
Solved

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 Interface
Moderation Team has archived post
Share this page LinkedIn