Skip to content
Prev 173737 / 398503 Next

Format about Date and time

On Mar 14, 2009, at 8:52 AM, Aimin Yan wrote:

            
You do not have a %Y format for years.

See if this minimal example helps::
timedf <- data.frame(Date1 = "12/20/08", Time1= "17:03:00")
strptime( with(timedf, paste(Date1,Time1) ), format="%m/%d/%y %H:%M:%S")
# [1] "2008-12-20 17:03:00"
David Winsemius, MD
Heritage Laboratories
West Hartford, CT