You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project shows how to keep a DateTime property in UTC format on both server and client sides when using a Grid with Ajax Binding and editing, and avoid the offset that is being added automatically.
3
+
This project shows how to keep a DateTime property in UTC format on both server and the client when using a Grid with Ajax Binding. It avoids the problem with the offset that is being added automatically.
4
4
5
-
Every time a date is being retrieved from the database or received from the client, the `DateTime Kind` property is left unspecified. The .NET framework implicitly converts such dates to local format.
5
+
Every time a date is being retrieved from the database or received from the client, the [DateTime Kind](https://msdn.microsoft.com/en-us/library/system.datetime.kind(v=vs.110).aspx) property is left unspecified. The .NET framework implicitly converts such dates to local format.
6
6
7
-
Similar thing happens on the client side. Browsers convert all dates according to local time when the Date.
7
+
Similar thing happens on the client side. Browsers convert all dates according to local time when the Date is initialized from milliseconds value.
8
8
9
-
For example when you create a JavaScript date like this `new Date(1353397262112)`different browsers which machines use different TimeZones will show different string representations of that Date.
9
+
For example, when you create a JavaScript date like this `new Date(1353397262112)` browsers in different time zones will show different dates.
10
10
11
11
So in order to keep time in UTC, explicit transformation should be applied to the dates on both client and server sides.
0 commit comments