I have imported some data from Excel containing a date and time cell. When I try to convert the data into a date and time format I only get very strange results. If I go for only date there is no problem and I get the correct date. (I am working in MacOS)
date <- 40259.93645833333
as.POSIXlt(date,origin='1904-01-01 00:00:00')
"1904-01-01 12:10:59 CET"
as.POSIXlt(date,origin='1970-01-01 00:00:00')
"1970-01-01 12:10:59 CET"
as.POSIXlt(date,origin='2010-01-01 00:00:00')
2010-01-01 12:10:59 CET"
as.Date(date,origin='1904-01-01')
"2014-03-23" #Correct date
I would like to know how to proceed and keep the time as well.