We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Datetime values differs from the actual time selected when the client is located in different time zone

Why DateTimePicker changing time when application hosted in different Time zone

EJ DateTimepicker control is used to get the Date and Time values from the user with a specific format.

For websites hosted in different Time zone, the time being selected in different time zone will differ with respect to the local time.

So, in order to overcome this Time zone discrepancy, the date time value being selected on client end will be converted to its equivalent Coordinated Universal Time (UTC) on server end.

Say, for example if the date time selected is 12/22/2016 7:30 AM, where the Time Zone is 5.30 hours ahead of UTC, then at the server end, the time will be converted to its equivalent UTC i.e., 12/22/2016 2:00 AM.

This conversion is done in order to overcome the time zone discrepancies across the world.

Now, to receive the equivalent local date and time as selected by the user in different time zone (say, 1.30 hours behind the UTC), it can be done by adjusting the value with local Time Zone offset as given below.

HTML

 

With this conversion, you can get the date and time selected by the user in a different time zone.

So, the local time would be 12/22/2016 0:30 AM at the time when the user has selected 12/22/2016 7:30 AM.

 

Article ID: Published Date: Last Revised Date: Platform: Control:
7184 01/03/2017 01/03/2017 JavaScript ejDateTimePicker
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.