0

I have a data frame with RFC 3339 format ("2012-04-12T19:02:32Z") and I need to turn into a date type R, I found as.POSIXct function but can not use it properly.

1 Answers1

2

Try this:

R> as.POSIXct("2012-04-12T19:02:32Z", format="%Y-%m-%dT%H:%M:%SZ")
[1] "2012-04-12 19:02:32 CDT"
R> 

The arguments for the format string are detailed in the help page.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725