Ale*_*lex 6 timezone r posixct xts timestamp-with-timezone
我xts在索引为POSIXct和时区为GMT 的对象中有一堆1分钟的返回.回报是在纽约证券交易所,所以我想转换到东部时区,但我想妥善照顾夏令时.这样做的最佳方式是什么?我在EST时区和EDT时区之间有点困惑.我想在冬季和夏季将我的时间恰当地转换为纽约时报.
使用indexTZ<-和America/New_York时区
> tail(SPY)
SPY.Bid.Price SPY.Ask.Price SPY.Trade.Price SPY.Mid.Price SPY.Volume
2012-08-09 19:54:00 140.47 140.48 140.48 140.475 2372
2012-08-09 19:55:00 140.46 140.47 140.46 140.465 5836
2012-08-09 19:56:00 140.47 140.48 140.48 140.475 2538
2012-08-09 19:57:00 140.47 140.48 140.47 140.475 2209
2012-08-09 19:58:00 140.48 140.49 140.49 140.485 4943
2012-08-09 19:59:00 140.58 140.59 140.58 140.585 16780
> indexTZ(SPY) <- "America/New_York"
> tail(SPY)
SPY.Bid.Price SPY.Ask.Price SPY.Trade.Price SPY.Mid.Price SPY.Volume
2012-08-09 15:54:00 140.47 140.48 140.48 140.475 2372
2012-08-09 15:55:00 140.46 140.47 140.46 140.465 5836
2012-08-09 15:56:00 140.47 140.48 140.48 140.475 2538
2012-08-09 15:57:00 140.47 140.48 140.47 140.475 2209
2012-08-09 15:58:00 140.48 140.49 140.49 140.485 4943
2012-08-09 15:59:00 140.58 140.59 140.58 140.585 16780
Warning message:
timezone of object (America/New_York) is different than current timezone (GMT).
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4898 次 |
| 最近记录: |