Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top