[英]Convert a date object into unix timestamp in R?
Usually we see people converting unix-timestamps into date objects - is it possible to do the reverse instead?通常我们会看到人们将unix-timestamps转换为 date 对象 - 是否可以反过来做?
For example, given the following date例如,给定以下日期
12-02-2019 00:00:00
convert this into unix time achieving the following value:将其转换为 Unix 时间,实现以下值:
1549929600
Is this possible within r ?这在r 中可能吗? Potentially there could be something in lubridate or tidyverse but I have not figured it out yet.
lubridate或tidyverse 中可能有一些东西,但我还没有弄清楚。 Thanks for the help.
谢谢您的帮助。
找到答案很简单:
as.numeric(as.POSIXct("12-02-2019 00:00:00 EST"))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.