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.

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