I wrongly stored the result of Sys.time() as type character. E.g., "2014-05-05 10:52:11 CEST" is converted to "1399279910.87737". How can I get the time back?

有帮助吗?

解决方案

This should work:

as.POSIXct(as.numeric("1399279910.87737"), origin="1970-01-01")

The difference ought to be because of the rounding in the string representation. You could try playing with origin to make it match if the difference of a few seconds is a problem.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top