cconnell
cconnell

Reputation: 863

recoding facebook timestamp in R

How do I recode of vector of timestamps from a facebook api pull that is a factored looking like the following to a time/date variable?

[[1] 2012-10-19T19:52:43+0000

I tried the following, but I only get NAs:

strptime(as.character(time), "%Y-%b-%dT%H:%M:%S+0000")

Upvotes: 0

Views: 146

Answers (1)

Joshua Ulrich
Joshua Ulrich

Reputation: 176688

Your format is wrong. The %b should be %m.

> strptime("2012-10-19T19:52:43+0000", "%Y-%m-%dT%H:%M:%S+0000")
[1] "2012-10-19 19:52:43"

Upvotes: 1

Related Questions