Support Article
Creation date in the case attachment always displays in GMT
SA-66257
Summary
The creation date in the case attachment always displays in the GMT format and does not consider the user locale.
Error Messages
Not Applicable.
Steps to Reproduce
- Set the user timezone to a different one from the server
- Create a case
- Add a URL in the media content
- Check the time in the case attachments
Root Cause
A defect in Pegasystems’ code or rules.
Resolution
Perform the following local-change:Replace below code in pyAttachmentFeedDescription in UI Kit:
try{
String createDateTime = primary.getString("pxCreateDateTime");
java.text.SimpleDateFormat simpleDateFormat = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss", Locale.getDefault());
Date parsedDate = simpleDateFormat.parse(createDateTime);
java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat("MMM. dd, yyyy hh:mm aa");
formattedDate = dateFormat.format(parsedDate);
} catch(Exception e) {
}
With:
try{
formattedDate = pega_rules_datetime.FormatDateTime(primary.getString("pxCreateDateTime"),"MMM dd, yyyy hh:mm aa z",null,null);
} catch(Exception e) {
}
Alternatively, upgrade to UI Kit- 8.1.
Published October 12, 2018 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.