[R] as.POSIXct before and after 1970

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Oct 17 20:06:25 CEST 2005


Your OS is?  I cannot reproduce this on any of mine.

Sone OSes do not support dates before 1970, which would explain the 
difference.  R then has to guess when summer time ended in 1969, and I 
suspect something is happening inconsistently.

Also, "EST" is not a real-world POSIX timezone and may well not be 
implemented fully.

On Mon, 17 Oct 2005, Omar Lakkis wrote:

> Can someone, please, explain the difference in as.POSIXct results
> before 1970 and on and after 1970 as illustrated below.
>
> After 1970, the use of 'EST' or "EST+5EDT' as the timezone does not
> affect the result of asPOSIXct, but before 1970 on 10/28 the results
> are different.
>
>> as.POSIXct('1970-10-29', tz='EST')+1
> [1] "1970-10-29 00:00:01 EST"
>> as.POSIXct('1970-10-29', tz='EST+5EDT')+1
> [1] "1970-10-29 00:00:01 EST"
>
>> as.POSIXct('1969-10-29', tz='EST')+1
> [1] "1969-10-29 00:00:01 EST"
>> as.POSIXct('1969-10-29', tz='EST+5EDT')+1
> [1] "1969-10-28 23:00:01 EST"
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list