arrow icon indicating copy to clipboard operation
arrow copied to clipboard

Function to('US/Pacific') incorrectly shifting timezone to -7 instead of -8

Open perendipity opened this issue 12 years ago • 2 comments

It isn't currently daylight savings time so I would expect .to('US/Pacific') to make the timezone offset -8 but arrow sets it to -7

image

perendipity avatar Jan 10 '14 22:01 perendipity

From what I understand, the Readme doesn't say anything about this library being day-light savings time aware. Rather, it has doctests in arrow/arrow.py under the method def to(self, tz): expecting precisely what you discovered:

>>> utc = arrow.utcnow()
>>> utc
<Arrow [2013-05-09T03:49:12.311072+00:00]>

>>> utc.to('US/Pacific')
<Arrow [2013-05-08T20:49:12.311072-07:00]>

Should this not be converted into a feature request for the Arrow library to be day-light savings aware?

sochoa avatar Feb 08 '14 21:02 sochoa

I don't see a bug here. the dst transition in 2013 happened on mar 10 at 2am local time.

these dates are on either side of the transition:

In [27]: arrow.Arrow(2013, 3, 9).to('US/Pacific')
Out[27]: <Arrow [2013-03-08T16:00:00-08:00]>

In [28]: arrow.Arrow(2013, 3, 11).to('US/Pacific')
Out[28]: <Arrow [2013-03-10T17:00:00-07:00]>

petergx avatar Mar 13 '14 19:03 petergx