javascript - Date object to JSON weird behaviour -


i have issue dont know if feature or bug .. :)

just try 2 lines of code (you can try angular-like or json.stringify, whatever)

console.log(angular.tojson(new date()));  // ""2015-07-16t10:32:35.762z"" console.log(new date()); // thu jul 16 2015 12:32:37 gmt+0200 (cest) 

i expect date same but... in first case local (gmt + 2), in second case 'jsonized'... gmt! in case -2 hours.

do know maybe what's problem here? general rule :)?


Comments