The Dates retrieved from the database will be converted based on the local time zone in both client and server end. Converting the Dates to UTC format will prevent the time offsets difference between server and client time zones.
To prevent the Date conversion and to display all the dates in UTC format, the following steps have to be done on both client and server side.
The dates from the database must be returned in UTC format. To do that, set the DateTime Kind property to UTC. Refer to the following code,
Now the Dates will be returned to the view in UTC format.
When the returned dates are parsed in client end using “new Date()” method, it will be converted to client’s time zone. To avoid that, set ej.parseDateInUTC to true. Refer to the following code,
Now the all the Dates will be displayed in UTC format.
This page will automatically be redirected to the sign-in page in 10 seconds.