Applies to Pega Platform 7.2-8.7.5
Understand how Configurable Timezone option support in the DateTime control works and how to configure Design Time. Learn the behavior of the DateTime control, the symptoms and root causes of the issues related to the DateTime control in your Pega applications, and how to prevent and resolve them. The scenarios describe issues with Date Time that users have reported.
Configurable Timezone option support in DateTime control
Configuring Design Time
Configuring Time zone source
Specifying DateTime and custom time zone
Additional information
Diagnosing and debugging DateTime issues
Configurable Timezone option support in DateTime control
Custom time zone configuration on the DateTime control enables users to select or view DateTime value in the required time zone instead of the Operator’s time zone.
Consider this example: A manager and his or her reporting employees are in different time zones. While scheduling an employee’s shift, the manager is supposed to verify time in the employee’s time zone and select the value accordingly. However, with this feature, the manager is able to set the custom time zone to the employee’s time zone and the employee is able to directly select the DateTime value without verifying the DateTime value in his or her time zone.
Configuring Design Time
-
Open the Properties panel on the DateTime control.
-
Open the Presentation tab on the Properties panel.
-
Navigate to Time zone source in the Editable Settings section.
-
Configure Time zone source by selecting the relevant option.
-
Click
.
The following image illustrates the different options available for Time zone source:
Configuring Time zone source
Time zone source |
Explanation |
Operator timezone |
radio button is selected by default. This is determined by the configuration of the Operator at run time.
|
Standard timezones |
A dropdown with standard time zones displays on selecting the Standard timezones radio button. Select one of the standard time zone options on the dropdown.
|
Property |
Select the Open Rule Advanced control that enables users to select the property, displays, on selecting the radio button. radio button to provide custom time zone based on the value of property reference. TheThe control responsible for modifying the property reference value must be configured with the Refresh Section action such that the section with the DateTime control is updated according to the time zone selected. |
Specifying DateTime and custom time zone
If Default locale is blank in the Operator ruleform, then the locale information is fetched from the Browser Language Settings (similar to the Internet options for the Internet Explorer browser on Windows). This occurs when the DateTime control has locale and timezone configuration in the Operator ruleform.
For example, when English - United States is selected for Browser Language, the Default Locale is set to en_US.
On clicking the Calendar icon when DateTime value is blank, the Date picker populates with DateTime value in the time zone configured on the control instead of the system time. This occurs when the custom time zone is configured on the DateTime control.
Additional information
-
On the server side, the DateTime values submitted by a user are considered to be in the Operator timezone. The DateTime values are converted to GMT before setting the values to the property on the Clipboard. In all the Submit scenarios, the DateTime values are sent to the server after they are converted to the Operator time zone value.
-
An extra attribute, data-custom-timezone, generates on input tag with the value of the timezone.
-
On modifying or selecting the DateTime value, the data-value and value attributes of input are updated.
-When the option is set to Yes, both the data-value and the HTML standard attribute value are same. The HTML standard attribute value is converted to the target timezone (the Operator’s time zone) while it is sent to the server.
-When the Allow Text Entry option is set to No, the data-value is set to the selected value and the input value (HTML standard attribute value) is updated to converted value such that no extra code changes are required while sending the input value to the server.
-While receiving the input values from the server, data-value and value attributes are updated accordingly.
Diagnosing and debugging DateTime issues
Issues with DateTime have been reported by users. The following scenarios describe the issues:
Scenario 1: Current DateTime does not display in section
DateTime function displays the function name instead of the current date and time on a section.
Environment
The reported behavior occurs in Pega Platform™ version 8.1.5 in an on-premises deployment.
Explanation
When the control is configured to Read-only (always) Constant, the Constant value (the string as it is without any resolution) displays. In this use case, the @(Pega-RULES:DateTime).CurrentDateTime() string displays, but not the Resolved value.
However, when the above configuration is run in the Non-Template mode, the control fetches the value from the property that is bound to the control and does not display the constant value. This property that is bound to the control may possess the current DateTime value always. Hence, the DateTime value displays in the Non-Template mode. However, in the Template mode, the control picks and displays the mentioned constant string (in this case, @(Pega-RULES:DateTime).CurrentDateTime()).
Solution
Best practice: Keep current with Pega
Perform the following local change:
- In the Presentation tab, configure with Property Value.
- In the General tab, bind DateTime time property reference and populate this value using a data transform to have the current DateTime (data transform > Set {propertyVariable} to @(Pega-RULES:DateTime).CurrentDateTime()).
Scenario 2: Date displays instead of DateTime value
A user (User1) enters DateTime value and routes it to another user (User2). On the initial load of read-only Perform harness, the Date value only displays for User2 even though the property contains a DateTime value on the clipboard.
Environment
The reported behavior occurs in the following environments:
- Pega Platform version 8.1.1 on-premises
- Pega Platform version 7.4 in Pega Cloud® services 2.20.8
Explanation
The reported behavior occurs when the DateTime property is configured as Read-only (when).
Solution
Best practice: Keep current with Pega
Perform the following local change:
- Open the cell property of the DateTime property that is Read-only (when).
- Open the Presentation tab.
- Set the Type option to Date/Time.
- From the Date-time format list, select Custom.
- Enter a valid format in the adjacent unlabeled field: dd/MM/yyyy hh:mm:a
Scenario 3: Unable to access Date picker in the DateTime control
Unable to access the Date picker in the DateTime control with the keyboard. That is, on clicking the Date control, the focus moves to the next control instead of to the Date picker.
key (on the Keyboard) in theExplanation
The Date control with Display mode is used as Text input+Calendar, for which the calendar is a part of the Input element as an image. (It is not considered as a separate input.) Hence, when the user clicks the key, the focus moves to the next input field instead of to the Date picker.
Solution
Best practice: Keep current with Pega
See SA-106478, Unable to access Date picker in DateTime control
Scenario 4: Same DateTime property displays in different time zones
A screen flow is present in a case type where on Assignment 1 of the screen flow, the DateTime property displays as editable and the value of this property populates on load as required. On Assignment 4, the value displays in the read-only format.
The screen flow displays the time on the editable field according to the user's time zone; and on the read-only screen, it displays the time as per the CET. The user's time zone is Europe- Instanbul. That is, the same section displays at both the locations.
Explanation
The DST timing is changed from +2 hours GMT to +3 hours GMT. However, in the Pega application, the Moment JavaScript library continues to follow the +2 hours GMT.
Solution
Best practice: Keep current with Pega
See SA-103080, Same DateTime property displays in different time zones.
Scenario 5: Incorrect date displays for DateTime control for th_TH locale
Incorrect date displays for the DateTime control for the th_TH locale. The DateTime control does not consider the Thai Solar Calendar.
Explanation
The issue is due to the incorrect configuration of the DateTime control.
Solution
Best practice: Keep current with Pega
See SA-85718, Incorrect date displays for DateTime control for th_TH locale.
Scenario 6: Empty DateTime property returns date as 19700101T000000.000
The disableEpochDate and disableEpochDateTime Dynamic System Settings (DSSs) are set to True. However, an empty DateTime property displays 19700101T000000.000.
Explanation
The disableEpochDateTime DSS is applicable only to the Integration layer that relies on the following Application Programming Interface (API) internally:
com.pega.pegarules.pub.util.PRDateFormat.formatXSDDateTime(Date)
The SET (Set value) action or Property-Set methods in the Clipboard layer return the default value to the properties of type DateTime and the default value is 01-jan-1970. The Clipboard layer does not return an empty or blank value.
Solution
Best practice: Keep current with Pega
See SA-86194, Empty DateTime property returns date as 19700101T000000.000.
Scenario 7: Inconsistency in DateTime property values
Inconsistencies occur in the DateTime property values exposed in the database columns between the data that is migrated and the data that is created after an upgrade. The exposed DateTime property values are in GMT for the data that is migrated. The exposed DateTime property values are in the database (DB) server's time zone (EST) for the newly created data.
This inconsistency causes functional errors considering an item as stale when it is not.
Error Message
Obj-Refresh-And-Lock
Explanation
The new Java Virtual Machine (JVM) uses time zone settings that are different from the original JVM that is used when the data is exposed. The existing database is copied using the database tools and a new JVM is implemented. When the new JVM references the exposed values considering the exposed values in the set timezone, miscalculations occur.
Solution
Best practice: Keep current with Pega
See SA-94953, Inconsistency in DateTime property values.
Scenario 8: DateTime value passed as an activity parameter
You have designed the application to pass the DateTime value as a parameter to an activity. When the activity runs, the DateTime value converts to a Date value.
Environment
The reported behavior occurs in Pega Platform version 8.5.2 in an on-premises deployment.
Explanation
The reported behavior occurs when the DateTime property is set to Editable.
Solution
Best practice: Keep current with Pega
Perform the following local change:
- Click the DateTime control. icon of the
- Open the Presentation tab.
- Select the Auto/DateTime option to specify Edit options for Date time control.
Scenario 9: Standard time zones display in GMT format when property validation fails
You have specified the DateTime property to display in one of the standard time zones for the Calendar. A Validate rule on a flow action adds messages to the DateTime property. If the validation fails (for example, validation of property for past date, future date, and so on), the value in the Calendar is displayed in GMT format instead of in standard time zones.
Environment
The problem was reported for Pega Platform version 8.7.4 in Pega Cloud® services 2.24.4.
Solution
Best practice: Keep current with Pega
If you cannot update your Pega deployment and need to keep using Pega Platform 8.7.4, obtain and install HFix-84999.
This fix is delivered in Pega Platform 8.7.5 and subsequent releases.
See the Resolved Issues for Pega Platform 8.7.5, the capability section User Experience, Ticket # INC-254059, Issue # 772432.