Calendar Control displays different Date in different Time Zones

  • 16 February 2021
  • 0 replies
  • 309 views

Userlevel 5
Badge +20
 

Calendar Control displays a different Date value in different Time Zones

kbt135043

PRODUCT
K2 blackpearl 4.7
BASED ON
K2 blackpearl 4.7
This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
LEGACY/ARCHIVED CONTENT
This article has been archived, and/or refers to legacy products, components or features. The content in this article is offered "as is" and will no longer be updated. Archived content is provided for reference purposes only. This content does not infer that the product, component or feature is supported, or that the product, component or feature will continue to function as described herein.

Issue

A Calendar Control may display a Date with an incorrect day value when viewed in different Time Zones.

Symptoms

When a Calendar Control is used to display a Date Value retrieved from a SmartObject, the date may be displayed as either the day before or after the actual date saved.  The issue can occur when a SmartForm is accessed from a different Time Zone than the K2 Server.

Resolution

This behaviour is correct by design and can be explained as follows:
 

 

The Date/Time value is submitted in the Calender Control with the User’s Time Zone value (e.g UTC+5). The K2 server then converts the Value to Server Time Zone before saving it to a SmartObject (e.g. UTC). When this value is retrieved by a user in a different region, their Time Zone offset is again applied to the value (e.g UTC-5). This will result in a date possibly being displayed differently from how it was saved by the original user.

 

This is expected behaviour. To stop the time zone conversions from being applied, the following Rule can be added to set the Control to always use a specific time zone, irrespective of a User's local time zone:

 

When the View executed Initialized, then set the properties of [Calendar control]. In the rule (configure), set the “Display Time Zone” to the preferred value (e.g UTC).

 

Image


0 replies

Be the first to reply!

Reply