【发布时间】:2015-01-26 18:41:48
【问题描述】:
据我了解,EST、US/Eastern 和 America/New_York 应该是相同的,但显然我错了。
当我执行以下操作时:
pd.Timestamp('2011-07-03T07:00:00-04:00').tz_convert('US/Eastern')
给了:
Timestamp('2011-07-03 07:00:00-0400', tz='US/Eastern')
当我这样做时:
pd.Timestamp('2011-07-03T07:00:00-04:00').tz_convert('EST')
它给出:
Timestamp('2011-07-03 06:00:00-0500', tz='EST')
当我这样做时:
pd.Timestamp('2011-07-03T07:00:00-40:00').tz_convert('America/New_York')
它给出:
Timestamp('2011-07-04 19:00:00-0400', tz='America/New_York')
谁能给我一些关于这个的见解?我需要转换我的时间戳,以便它可以与纽约证券交易所的时间相媲美。现在我不知道使用哪个时区。感谢您的帮助。
我的代码中有一个错字(感谢 BrenBarn),所以时区:America/New_York 和 US/Eastern 实际上是相同的。
【问题讨论】:
-
你为什么在一个中使用
-0400,在另一个中使用-04:00,在第三个中使用-40:00?
标签: python pandas timezone timestamp