gpt4 book ai didi

从 R 中的数据中删除 BST 和 GMT,然后查看时间

转载 作者:行者123 更新时间:2023-12-01 04:50:08 25 4
gpt4 key购买 nike

我试图在 R 中找到时间戳,所以我使用了任何时间函数,如下所示:

Timestamp = anytime::anytime(paste(Date, Time)) 

但后来我意识到时间戳有 BST 和 GMT。如何在没有 GMT 或 BST 的情况下获取时间戳?

谢谢!

最佳答案

函数anytime返回可以以任何所需格式显示的 POSIX 时间对象。要省略时区,您只需将其保留在格式规范中:

x = anytime::anytime(paste(Date, Time))
Timestamp = format( x, "%Y-%m-%d %H:%M:%S" )

?format.POSIXct想要查询更多的信息。

关于从 R 中的数据中删除 BST 和 GMT,然后查看时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41961512/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com