Alex
Alex

Reputation: 4995

Convert Uncommon Date Format

Is there an easy way to transform this string into a meaningful date format?

date <- "Tue Apr 04 10:18:33 +0000 2017"

Right now I would use some regex and then the lubridate package. But I guess there is a less complicated way.

Upvotes: 1

Views: 37

Answers (1)

G. Grothendieck
G. Grothendieck

Reputation: 270268

Try this:

as.POSIXct(date, format = "%a %b %d %H:%M:%S %z %Y")

Upvotes: 3

Related Questions