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

Kendo Date Problem in Grid

3 Answers 135 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Shahul
Top achievements
Rank 1
Shahul asked on 16 Nov 2012, 06:48 AM
If i select today in kendo date picker in add screen, kendo set the selected date as yesterday date in Grid.

i attached add screen image and kendo grid display date.

3 Answers, 1 is accepted

Sort by
0
Bradley Fulton
Top achievements
Rank 1
answered on 21 Nov 2012, 03:44 PM
I had the same problem happen to me.  In essence, it was caused because my server was in a different timezone than my development machine.
0
Apostolos
Top achievements
Rank 1
answered on 26 Feb 2013, 09:06 AM
@Bradley what does the server has to do with this problem? I have the same behavior and since the date in our server is not saved in UTC we don't wan't to remove the timezone diff.
0
Bradley Fulton
Top achievements
Rank 1
answered on 26 Feb 2013, 04:23 PM
It's been a little while, but what I think happened was this:
- the date is entered on the client.  It doesn't really have a time, but it's implicitly 12 AM (i.e. zero).
- the date is saved to the server -- it adjusts the time according to the difference in the time zone (back one hour in my case), making it 11 PM (2300) on the previous date
- when I next display the date, the code cuts off the time portion, and ends up with the previous date

I fixed the problem by forcing the system to take the dates as UTC everywhere, so it would stop converting it.  Was a bit painful, though. I think it's unfortunate that .NET doesn't have a proper Date type rather than just use DateTime for everything.
Tags
Date/Time Pickers
Asked by
Shahul
Top achievements
Rank 1
Answers by
Bradley Fulton
Top achievements
Rank 1
Apostolos
Top achievements
Rank 1
Share this question
or