Skip to content
Prev 323682 / 398506 Next

strftime

On May 16, 2013, at 10:43 AM, Dominic Roye wrote:

            
What do you mean by "eliminating the hours"? You only showed us three instances, none of which had anything other than "00" for the hours. More fundamentally however, strftime() is designed to take POSIXt arguments while you are sending it "character" arguments. Why would you want to use strftime on character data anyway? I would argue that the expected result from passing a character vector should be undefined.
I have found that giving erroneous data in the time section of just some of the input will "zero out" all of the time values on my system (R 3.0.0 on MacOSX 10.7.5):

dts <- c("2006-01-01 25:10:00", "2006-01-01 00:20:00", "2006-01-01 00:30:00")
strftime(dts,format="%Y-%m-%d %H:%M:%S")

#[1] "2006-01-01 00:00:00" "2006-01-01 00:00:00" "2006-01-01 00:00:00"

So my guess would be that you have impossible-to-format time data after the 500 mark. The help page says these behaviors are systemm-specific and you have not suppled the requested details of you version or OS.

It would be better to submit a _small_ data object (not all of a 315504 element vector)  in a form that can reproducible, preferably the output from dput(object).