[R] Dates and times from Excel

Hans-Peter Suter gchappi at gmail.com
Mon Feb 23 10:00:13 CET 2009


> Excel stores times of the day as fractions of a day so I wrote a function to
> convert the fraction to a number of seconds, extract the hours, minutes and
> seconds and output it in ISO standard format (%H:%M:%S).

What about the 'colClasses' or 'dateTimeAs' argument in 'read.xls'
which gives back an iso-date-time character string. Or you could use
the 'dateTimeToStr' function to convert the date number to a character
string formatted as indicated.

As a question: would additional entries (e.g.) 'posixctdatetime'
and/or 'chrondatetime' for the 'colClasses' argument be useful?

-- 
Regards,
Hans-Peter




More information about the R-help mailing list