我的理解是 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 实际上是相同的。
我是一名优秀的程序员,十分优秀!