jrara
jrara

Reputation: 17021

How to convert date as.POSIXct?

I'm trying to convert dates using as.POSIXct

dates <- c("1-DEC-2011 00:56:06.82", "1-DEC-2011 01:29:57.07", "1-DEC-2011 01:49:05.37",
"1-DEC-2011 01:50:04.97", "1-DEC-2011 01:54:44.53", "1-DEC-2011 01:55:03.10"
)
as.POSIXct(dates, tz="", format="%d-%b-%Y %H:%M:%S")

This produces a vector of NA:s. How this conversion on is done?

Upvotes: 0

Views: 1692

Answers (1)

aatrujillob
aatrujillob

Reputation: 4826

Try:

Sys.setlocale("LC_TIME", "English") 

#put your timezone

and run your code again.

Upvotes: 2

Related Questions