Daniel Estévez
Daniel Estévez

Reputation: 115

SAS date and time to Normal date and time format (Y-M-D H:m:S)

I have obtained data from a remote tagging experiment and the dates are in SAS format (43255.940972). The last level of information I want to extract are seconds. I was trying this:

as.Date(data$Date, origin = "1960-01-01 00:00:00", "%Y-%m-%d %H:%M:%S")

But all I get in return is Year-Month-Day but no time details. How do I specify, using this command that I also want that information to be returned?

Thanks

Upvotes: 0

Views: 246

Answers (1)

EJJ
EJJ

Reputation: 1513

Based on the answer provided by @Onyambu

as.POSIXct(a*86400,origin="1899-12-30")

Some documentation you can read on those functions and date time in general.

Upvotes: 1

Related Questions