Im converting a date and time string to a Date object:
var timestamp = "2013-05-02T07:18:37";
var toDate = new Date(timestamp);
console.log('timestamp is: ' + timestamp);
console.log('toDate is ' + toDate);
I get the result:
timestamp is: 2013-05-02T07:18:37
toDate is: Thu May 02 2013 08:18:37 GMT+0100 (GMT Daylight Time)
As you can see, the time is adjusted by 1 hour. Im testing in Chrome on windows 7. I do not want to time adjusted by 1 huor. How do I do this?
console.log('toDate is ' + toDate.toUTCString());
The specification says about
toString (which is implicitly called when you just use
toDate) (emphasis mine):
The contents of the String are implementation-dependent, but are intended to represent the Date in the current time zone in a convenient, human-readable form.