This is a migrated thread and some comments may be shown as answers.

How to Display local version of utc date

5 Answers 162 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 02 Mar 2011, 07:46 AM
Hi there.

My server is in California and my users are in New Zealand. Everything is being stored in the database as UTC. When I save a record it shows it as being saved 19 hours earlier.

Is there a simple way of detecting the users timezone through the browser adn adjusting the time and date appropriately?

Thanks
Chris

5 Answers, 1 is accepted

Sort by
0
Chris May
Top achievements
Rank 1
answered on 15 Mar 2011, 03:47 AM
I'd also like to know this.

I was hoping somehow there is a simple way to convert the UTC values to the browser's timezone via javascript.
0
Chris
Top achievements
Rank 1
answered on 15 Mar 2011, 08:50 PM
In today's internet age you would have thought this would be so simple!
0
Maria Ilieva
Telerik team
answered on 17 Mar 2011, 02:18 PM
Hello Chris,

Note that the required functionality is not directly related to any our control. This is a generic browser issue which is out of our scope.The RadCalendar is returning Date type of object and its transformation to a date in the particular time zone depends on the browser side. So we could not change this logic as it is not directly related to our control.


Kind regards,
Maria Ilieva
the Telerik team
0
Chris May
Top achievements
Rank 1
answered on 17 Mar 2011, 07:42 PM
I believe the Scheduler works by having the dates written on the page using javascript, which can translate dates between the server and the client.  I would have thought this same technique could be used for date columns on the radgrid.
0
Maria Ilieva
Telerik team
answered on 22 Mar 2011, 04:23 PM
Hello,

I would suggest you to review the following kb article which gives some more light on this matter.

Best wishes,
Maria Ilieva
the Telerik team
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris May
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or