From tlumley@u.washington.edu  Mon Jul 22 17:57:24 2002
From: tlumley@u.washington.edu (Thomas Lumley)
Date: Mon, 22 Jul 2002 09:57:24 -0700 (PDT)
Subject: Date arithmetic fails (PR#1819)
In-Reply-To: <Pine.A41.4.44.0207220855460.93146-100000@homer41.u.washington.edu>
Message-ID: <Pine.A41.4.44.0207220944440.93146-100000@homer41.u.washington.edu>

>
> 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


Date arithmetic fails (PR#1819)
Thomas Lumley