I am working with JavaScript date’s being returned from ASP.net which is of course that really strange /Date(1328261701393)/ thing.
So I am parsing it out and doing…
var date = new Date(1328261701393);
console.log(date.toString()) // Fri Feb 03 2012 03:35:01 GMT-0600 (Central Standard Time)
When I change my system clock to EST, I get…
Fri Feb 03 2012 04:35:01 GMT-0500 (US Eastern Standard Time)
I THINK I understand why this is, but I am not entirely sure…
Also, I noticed that when I pass in an actual date string like…
console.log(new Date("2/1/2012 2:45:53 PM").toString());
I get the same time on both EST and CST…
Wed Feb 01 2012 14:45:53 GMT-0600 (Central Standard Time)
Wed Feb 01 2012 14:45:53 GMT-0500 (US Eastern Standard Time)
This all sort of makes sense, I was just looking for the WHY?
Javascript gives the time as per time zone of the browser. So, when you change your system clock, the time difference between your machine time and GMT changes. This difference is appearing in figures after GMT