Inconsistent month values with different timezone #32

Closed
lvauvillier opened this Issue Feb 12, 2013 · 2 comments

Comments

Projects
None yet
3 participants
new time.Date(2013, 1, 1, 'Europe/Paris');

{ Thu, 31 Jan 2013 23:00:00 GMT
  getTimezone: [Function: getTimezone],
  getDate: [Function: getDate],
  getDay: [Function: getDay],
....
}

All is OK.

new time.Date(2013, 1, 1, 'America/New_York');

{ Fri, 01 Mar 2013 05:00:00 GMT
  getTimezone: [Function: getTimezone],
  getDate: [Function: getDate],
  getDay: [Function: getDay],
....
}

Wrong month...

fewyun commented May 14, 2013

I can't duplicate this. May have been fixed.

Owner

TooTallNate commented Nov 10, 2013

What gets printed is the GMT representation of the Date object. So the first is after GMT, and the later is before GMT. This is the expected behavior. To wit, in the REPL:

> new time.Date(2013, 1, 1, 'America/New_York').toString()
'Fri Feb 01 2013 00:00:00 GMT-0500 (EST)'

> new time.Date(2013, 1, 1, 'Europe/Paris').toString()
'Fri Feb 01 2013 00:00:00 GMT+0100 (CET)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment