0

I am looking for a way to convert a simple POSIX time stamp like this

> time
[1] "2014-02-19 17:40:41"

into an UNIX time stamp. All solutions I found only worked the other way round. Can anybody provide some help? Thanks in advance!

chringel21
  • 126
  • 3
  • 10

1 Answers1

1

Have you tried this?

as.numeric(as.POSIXct("2014-02-20"))

From ?POSIXct

There are two basic classes of date/times. Class "POSIXct" represents the (signed)
number of seconds since the beginning of 1970 (in the UTC timezone) as a numeric vector.
Michele
  • 8,563
  • 6
  • 45
  • 72