I have an javascript object with Date property which is being converted to JSON using JSON.stringify
I am on GMT+4 time zone (Russia/Moscow)
For example,
5 Jan 2012
converts to 2012-01-04T20:00:00.000Z
5 Jan 1975
converts to 1975-01-04T20:00:00.000Z
But in 1975 it was GMT+3 time zone, as daylight saving was canceled in Russia in 2011. So when it cames to server (java) it deserializes as:
2012-01-04T20:00:00.000Z
becames 5 Jan 2012 00:00
- OK
1975-01-04T20:00:00.000Z
becames 4 Jan 1975
23:00 - WRONG!
What is the recommended way to convert Date object to JSON in Javascript?