dimanche 14 septembre 2014

Dates and Timezones

Testing around with dates(and timezones) I have found the following:

If the the date is specified like this in a JSON file:


{"testTime":"2014-09-14T10:21:28.098664"}


it is interpreted as UTC time. So if I display it in a grid, local time is added to the display value. (For example if my timezone is GMT +0200 the following time is displayed in grid column: 12:21:28)


But if I remove the T like this


{"testTime":"2014-09-14 10:21:28.098664"}.


The timestamp is interpreted as local time. So the time is displayed in grid column is (10:21:28).


Is this expected behavior? Can I always count on date being interpreted as UTC if T is used before time value and local time if not?






Dates and Timezones

Aucun commentaire:

Enregistrer un commentaire