Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

CurrentDate function is ignoring time zone



Developer configures the CurrentDate function but the time is from a different time zone (e.g. 3 hours ahead) and the date format is different than that requested.

For example, if I utilize the following code in an activity Log-Message step:
"DATE: " + @(Pega-RULES:DateTime).CurrentDate("YYYYMMDD", "BRT")

The logfile result is:
2014-07-31 09:04:00,032 [fault (self-tuning)'] [ STANDARD] [ App1:01.02.96] (Activity_Work.Action) INFO| username1 - DATE: Jul 31, 2014 12:04:00 PM

How can we get the format desired in the the Brazilian time zone?

Error Messages

Not Applicable 

Steps to Reproduce

Create a line in an activity and send the result to the log file:

This is the line : "DATA: " + @(Pega-RULES:DateTime).CurrentDate("YYYYMMDD", "BRT")

The log result is: 2014-07-31 09:04:00,032 [fault (self-tuning)'] [ STANDARD] ... - DATA: Jul 31, 2014 12:04:00 PM

Root Cause

The root cause of this problem is software use/operation error. The parameters to @CurrentDate were incorrect.


The explanation for this behavior is as follows:

The date format parameter was invalid.  The individual letters are case sensitive.  If a letter is provided that is not valid, then the whole format string is ignored.  The default format is used.  The 'y' for year was not supplied and 'Y' was used in error.  Same for 'd'.  The returned time was in GMT and so was ahead by 3 hours, affecting dates during part of the day.

The signifier for the Brazil Eastern time zone was switched to "Brazil/East"

@FormatDateTime(@CurrentDateTime(), "yyyyMMdd", "Brazil/East", "")

Published March 12, 2016 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us