Why time zone is "-04:56"?

Issue

The following code print 2022-01-01 05:30:00-04:56. What’s -04:56?

import pytz, datetime
tz = pytz.timezone("America/New_York")
t = datetime.datetime(2022, 1,1, 5, 30)
u = t.replace(tzinfo=tz)
print(u)

2022-01-01 05:30:00-04:56

In jupyter, u has the value of datetime.datetime(2022, 1, 1, 5, 30, tzinfo=<DstTzInfo 'America/New_York' LMT-1 day, 19:04:00 STD>). What’s DstTzInfo? And what’s 19:04:00 STD?

Solution

(Delete previous answer)

My bad: I parsed datetime.datetime(2022, 1,1, 5, 30) as 30 May (I’m answering this on 10 June.). We’re not in daylight savings time in January.

^ For me, this whole question is yet another reminder that I don’t * really * understand time.

OP. will you please remove this as an accepted solution? (It will not allow me to delete an accepted solution.)

Answered By – webelo

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published