Time Zone Conversion from Browser to Server and Server to Browser

  • 16 February 2021
  • 0 replies
  • 277 views

Badge +3
 

Time Zone Conversion from Browser to Server and Server to Browser

KB001919

PRODUCT
K2 smartforms 4.7
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.

 

Introduction

When using K2 across multiple time zones, it is important to understand how K2 converts date and time values from a client browser to the K2 server, and from the K2 server back to a client browser. 

 

 

Browser to Server Conversion

Any date or time value typed or selected in the browser is assumed to be in the client machine time zone. The date object in JavaScript has an underlying Coordinated Universal Time (UTC) value associated with it that handles the conversion to and from the browser's local time. This underlying value is sent to the IIS server as a UTC string using the Universal Sortable ("u") format.

The IIS server receives the UTC value and converts it to server's local date time. This value is sent on to the K2 server as a server local date time string using the Sortable ("s") format. The K2 server reads the value as a server local date time and passes it on to the SmartObject service. The SmartObject service defines how to send this on to the line of business (LOB) system.

Image

Server to Browser Conversion

The SmartObject service reads a date from the LOB system and converts it to a server local date time. This is sent through the SmartObject service as a server local string to the IIS server using the Sortable ("s") format.  

The IIS server receives the server local string, converts it to a UTC string using the Universal Sortable ("u") format, and sends this to the browser. The browser (SmartForms runtime) loads the date object from the UTC string and displays the date in the browser's time zone. 

Image

 


0 replies

Be the first to reply!

Reply