Dario Lacan
Dario Lacan

Reputation: 1140

Long Time format

I have some data with time measures in this format:

Sun Jun 01 10:07:42 +0000 2014

I can't find an easy way to read it in R, even with lubridate.

Do you know if this is a kind of standard time format that I can read in R somehow or if I should clean it up using regex?

Upvotes: 0

Views: 99

Answers (1)

Paul Hiemstra
Paul Hiemstra

Reputation: 60964

As far as I can tell, this does the trick use base R functions:

> strptime(s, format = '%a %b %d %H:%M:%S %z %Y')
[1] "2014-06-01 12:07:42"

See ?strptime for a more detailed description of the formatting

Upvotes: 2

Related Questions