Date arithmetic fails (PR#1819)

Thomas Lumley tlumley@u.washington.edu
Mon, 22 Jul 2002 09:57:24 -0700 (PDT)


>
> The problem appears to be with as.POSIXct on the Mac.  Operations that
> don't coerce to POSIXct work, those that do, don't.
>

I think I've found why.

The epoch date on the Mac is 1904-1-1 not 1970-1-1.

This has two effects. First, everything's off by 66 years. Second, it's
important to treat the time as unsigned long, not long, since it's already
greater than 2^31 some time in 1997.

Aren't standards wonderful?

	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._