Click here to Skip to main content
15,886,720 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Steps to reproduce the issue:

1. Open the Telerik asp.net mvc grid page shown in the below link.

http://demos.telerik.com/aspnet-mvc/razor/Grid/EditingAjax?theme=vista

2. Click on Add New Record button and enter a date in one of the date pickers in the grid. Click on save button.

3. Now change the TimeZone of your machine to a TimeZone which is running at least a few hours behind your current Time Zone and refresh the entire page (Ctrl+F5).

4. If there is a major time difference between the newly selected timezone and your default timezone then the previously saved date would get reduced by a day. For example: if the date you had saved was 1/1/2014 it would get changed to 12/31/2013.

5. Could you please help understand why this is happening and provide a solution that would prevent the date being reduced by a day depending on the client machine's time zone.

Thanks.
Posted

1 solution

In different time zones you may have different dates. For example in Israel it's Tuesday but in Baker Island still Monday and in Chatham Islands already Wednesday.
So it's perfectly right to see different dates for the same UTC from different time zones...
 
Share this answer
 
Comments
ahp-1984 14-Jan-14 8:07am    
1.Suppose i have Filled the Personal information Form and my DOB say 15-Jan-1980 in India.
2.Now i have Moved to Arizona Time Zone now am Accessing the my Personal Info Data so it will Show me my DOB as 14-Jan-1980.
3.So Ideally It Should So me the date which i have saved.So if i Chage my Location then For Each Location My DOB is Varing.
4.Do you Think This is Expected.
Kornfeld Eliyahu Peter 14-Jan-14 8:13am    
If you store UTC it's way that things should be, that because when in India was 15th of January 1980 in Arizona it's only the 14th...
If you want to display by India's time zone yous should not save UTC - but IMHO it's not good without strong reasons. More: in that case you have to mark that date as India's time zone to make sure users know what they see...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900