Support Article
Date/Time is not showing up in local time
SA-22706
Summary
When using a Tree Grid in a report on a manager's portal, earliest deadline of an assignment using the Min function in the report definition is shown.
On the UI, the date or time is displaying in GMT, while not showing the requestor's time zone.
This works as expected when report definition is run directly. It is only in the tree grid which is not showing properly using the same Date/Time control.
Error Messages
No error message, just wrong display
Steps to Reproduce
1. Create a report definition that uses the Min summary option on a Date/Time Field.
2. Add a Tree Grid that uses that report definition in a section, run the use-case and observe that date/time field is not displayed in local time.
Root Cause
A defect in Pegasystems’ code or rules,report viewer will always display values in user's time-zone specified in operator profile and grid does not have an option to format clipboard values, which is usually in GMT to a user's time-zone.
Resolution
Perform the following local-change step that makes drill-down report to show values in GMT instead of user's timezone:
Create a custom control, for example Export_DateTime:
<%
ClipboardProperty curProp = tools.getActive();
if ((curProp.getType() == PropertyInfo.TYPE_DATE || curProp.getType() == PropertyInfo.TYPE_DATETIME || curProp.getType() == PropertyInfo.TYPE_TEXT)&& curProp.size() > 0 && curProp.hasValidValue() && curProp.toDate()!=null) {
String sDatetime="";
String type = tools.getParamValue("DateTimeFormat");
String strTimeZone = tools.findPage("pxRequestor").getString(".pyUseTimeZone");
sDatetime = PRDateFormat.format(null, null, PRDateFormat.DEFAULT_DATETIME_SHORT, curProp.toDate());
tools.putSaveValue("result",sDatetime);
}
else {
tools.putSaveValue("result",tools.getActiveValue());
}
%>
<pega:reference name="$save(result)" />
2. Refer this control in the report definition datetime field under 'Edit Columns Options'.
Published May 4, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.