From ggrothendieck at myway.com  Mon Nov 22 05:18:12 2004
From: ggrothendieck at myway.com (Gabor Grothendieck)
Date: Mon Nov 22 05:18:23 2004
Subject: [Rd] strptime() bugs?
References: <1101090880.4260.12.camel@localhost.localdomain>
Message-ID: <loom.20041122T051551-294@post.gmane.org>

Juan Santiago Ramseyer <juan_sr <at> uol.com.br> writes:

: 
: strptime return wrong data?, look the R session.
: 
: # datetxt: vector of date in text format
: > datetxt <- c("1939-Oct-06 00:00:00", "1939-Oct-07 00:00:00", 
:                "1939-Oct-08 00:00:00", "1939-Oct-09 00:00:00")
: 
: > datehour <- strptime(datetxt,format= "%Y-%b-%d %H:%M:%S")
: > datehour
: [1] "1939-10-06 00:00:00" "1939-10-07 00:00:00" "1939-10-08 01:00:00"
: [4] "1939-10-09 00:00:00"
: 
: # look value of datehour[3] element, where hour output equal 01:00:00,
: # but hour input equal 00:00:00.
: 

On my machine it comes out like this:

R> datetxt <- c("1939-Oct-06 00:00:00", "1939-Oct-07 00:00:00", 
+ "1939-Oct-08 00:00:00", "1939-Oct-09 00:00:00")
R> datehour <- strptime(datetxt,format= "%Y-%b-%d %H:%M:%S")
R> datehour
[1] "1939-10-06" "1939-10-07" "1939-10-08" "1939-10-09"
 
R> R.version.string # Windows XP
[1] "R version 2.0.1, 2004-11-04"


[Rd] strptime() bugs?
Gabor Grothendieck