It is my understanding that EST, US/Eastern and America/New_York should be the same, but apparently I was wrong.
when I do the following:
pd.Timestamp('2011-07-03T07:00:00-04:00').tz_convert('US/Eastern')
which gave:
Timestamp('2011-07-03 07:00:00-0400', tz='US/Eastern')
when I do:
pd.Timestamp('2011-07-03T07:00:00-04:00').tz_convert('EST')
it gives:
Timestamp('2011-07-03 06:00:00-0500', tz='EST')
when I do:
pd.Timestamp('2011-07-03T07:00:00-40:00').tz_convert('America/New_York')
it gives:
Timestamp('2011-07-04 19:00:00-0400', tz='America/New_York')
could anyone give me some insight about this? I need to convert my timestamp so that it will be comparable with time for NYSE. Now I don't know which timezone to use. Thank you for your help.
There is a typo in my code (thanks, BrenBarn), so timezone: America/New_York and US/Eastern are actually the same.
To remove timezone from tz-aware DatetimeIndex , use tz_localize(None) or tz_convert(None) . tz_localize(None) will remove timezone holding local time representations.
I believe during that season, the U.S. is in day light saving time. According to this website:
http://www.timeanddate.com/time/zones/est
U.S. use EST in winter and EDT in summer.
and
http://www.timeanddate.com/time/dst/2011.html
In 2011, day light saving starts from March 13th until November 6th.
EST specifically refers to Eastern Standard Time, but the date you have chosen is during Daylight Savings Time.
Other than that, your examples will give the correct result if you use the same offset for all. You're using -0400
in some but -4000
in others (maybe due to a typo).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With