[R] strptime format argument

From: Hutchinson,David [PYR] <David.Hutchinson_at_ec.gc.ca>
Date: Mon, 28 Apr 2008 14:37:20 -0700

I am getting an unanticipated result attempting to format a datetime string  

date1 <- strptime('2005 297 1030 35', '%Y %j %H%M %S') # returns "2005-10-24 10:12:35"
date2 <- strptime('2005 297 912 35', '%Y %j %H%M %S') # returns NA  

Are there any ways to adjust the format argument (e.g., '%H') to accept one or two digit hours?  

Thanks in advance,


        [[alternative HTML version deleted]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 28 Apr 2008 - 21:56:22 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Apr 2008 - 22:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive