From tlumley@u.washington.edu  Mon Jul 22 16:57:43 2002
From: tlumley@u.washington.edu (Thomas Lumley)
Date: Mon, 22 Jul 2002 08:57:43 -0700 (PDT)
Subject: Date arithmetic fails (PR#1819)
In-Reply-To: <200207211826.UAA29493@pubhealth.ku.dk>
Message-ID: <Pine.A41.4.44.0207220855460.93146-100000@homer41.u.washington.edu>

On Sun, 21 Jul 2002 RML27@cornell.edu wrote:

> Full_Name: Ronnen Levinson
> Version: 1.5.1
> OS: Mac OS 10.1
> Submission from: (NULL) (12.232.201.92)
>
>
> The value returned by strptime behaves badly after arithmetic operation and/or
> combination.
>
> > a=strptime("2002-06-01 12:15:01","%Y-%m-%d %H:%M:%S")
> > a
> [1] "2002-06-01 12:15:01"
> > a+0
> [1] "1932-04-25 21:46:45"
> > a+3600
> [1] "1932-04-25 22:46:45"
> b=c(a)
> > b
> [1] "1932-04-25 21:46:45"

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

	-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