Skip to content

converting data to date format

1 message · Gabor Grothendieck

#
What version of Windows are you running?  I tried your commands
on Windows 2000 Pro and Windows XP Pro and was unable to reproduce
the output R gave you on either:
[1] "1970-01-01"
[1] "1970-01-02"
[1] "1970-02-01"
[1] "1970-12-31"
[1] "1970-01-01"
[1] FALSE
[1] "1970-01-01"
[1] FALSE
[1] "1970-01-02"
_              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    1              
minor    8.1            
year     2003           
month    11             
day      21             
language R
---
Date:   Sat, 14 Feb 2004 12:36:00 +0100 
From:   BXC (Bendix Carstensen) <bxc at steno.dk>
To:   Mike Hollegger <mike.hollegger at aon.at> 
Cc:   <r-help at stat.math.ethz.ch> 
Subject:   RE: [R] converting data to date format
...snip
...snip
There seems to be someting fishy about 1 january 1970, I think it
is a bug in Windows:
Error in fromchar(x) : character string is not in a standard unambiguous
format
[1] "1970-01-02"
[1] "1970-02-01"
[1] "1970-12-31"

A workaround is:
[1] "1970-01-01"

A peep at fromchar which is defined inside as.POSIXlt lead one to
try the following:
[1] TRUE
[1] "1970-01-01"
[1] FALSE
[1] "1970-01-02"

I would like to why this is so. And whether thereason for this
it is beyond R.

Btw, I use:
_ 
platform i386-pc-mingw32
arch i386 
os mingw32 
system i386, mingw32 
status 
major 1 
minor 8.1 
year 2003 
month 11 
day 21 
language R 

Bendix Carstensen
----------------------
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
bxc at steno.dk
www.biostat.ku.dk/~bxc

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html