Skip to main content
LinkedIn
Copied!

Table of Contents

Troubleshooting DateTime issues

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

  1. Open the Properties panel on the DateTime control.

  2. Open the Presentation tab on the Properties panel.

  3. Navigate to Time zone source in the Editable Settings section.

  4. Configure Time zone source by selecting the relevant option.

  5. Click Submit.

The following image illustrates the different options available for Time zone source:

Configuring Time zone source
"Navigate to Cell Properties > Time zone source. Choose the required option."
Configuring Time zone source

Configuring Time zone source

Time zone source

Explanation

Operator timezone

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 Property radio button to provide custom time zone based on the value of property reference. The Open Rule Advanced control that enables users to select the property, displays, on selecting the Property radio button.

The 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.

This behavior does not occur on mobile devices when the Use native control on mobile option is enabled.

Additional information

  1. 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.

  2. An extra attribute, data-custom-timezone, generates on input tag with the value of the timezone.

  3. On modifying or selecting the DateTime value, the data-value and value attributes of input are updated.

    -When the Allow Text Entry 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.

This is not applicable to mobile devices when the Use native control on mobile option is enabled. DateTime picker’s default DateTime value is set such that it is equal to the DateTime value in the Operator’s time zone instead of the device’s current time.

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.

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

See SA-82009, Current DateTime does not display in section.

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, only the date displays for User2 though the property contains a DateTime value on the Clipboard.

Explanation

The reported behavior occurs when the property is set to Read-Only (When).

Solution

See SA-75974, Date displays instead of DateTime value.

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 Tab key (on the Keyboard) in the Date control, the focus moves to the next control instead of to the Date picker.

Explanation

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 Tab key, the focus moves to the next input field instead of to the Date picker.

Solution

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

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

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

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

See SA-94953, Inconsistency in DateTime property values.

Did you find this content helpful?

100% found this useful


Related Content

Have a question? Get answers now.

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

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

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