无法格式化 POSIXct 数据以摆脱 EDT/EST 格式
我有一个大数据集,有许多不同的日期, 我想将它们转换为posixct,但不在乎时间,我所需要的只是在日期之间格式化相同的时间。
例如,我的原始日期格式
2019-03-08
2019-03-12
2018-10-30
2018-11-04
使用代码data $ newdate< - as.posixct(data $ date,tz =“ utc”)
变成
2019-03-08 19:00:00 EST
2019-03-12 20:00:00 EDT
2018-10-30 20:00:00 EDT
2018-11-04 19:00:00 EST
我知道,由此产生的格式的时代在技术上是相同的,但是我也需要这样的格式,但是我不知道如何。我应该使用的时区与UTC不同吗?
I have a large dataset with many different dates,
I want to convert them to POSIXct but do not care about times, all I need is for the time to be formatted identical between dates.
E.g. my original date format
2019-03-08
2019-03-12
2018-10-30
2018-11-04
when using the code data$newdate <- as.POSIXct(data$date,tz="UTC")
becomes
2019-03-08 19:00:00 EST
2019-03-12 20:00:00 EDT
2018-10-30 20:00:00 EDT
2018-11-04 19:00:00 EST
I know that the times in the resulting format are technically identical, but I need them to be formatted as such too, but I can't figure out how. Is there a different timezone I should be using than UTC?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能会令人沮丧,因为在解析、转换和格式化时可能会输入时区数据。
This can be frustrating as the timezone data can enter when parsing, converting, and formating.