From ligges at statistik.uni-dortmund.de  Wed Sep 14 14:18:55 2005
From: ligges at statistik.uni-dortmund.de (Uwe Ligges)
Date: Wed, 14 Sep 2005 14:18:55 +0200
Subject: [Rd] as.Date() , feature or bug?
In-Reply-To: <6ea7b543050913183858e052f4@mail.gmail.com>
References: <6ea7b543050913183858e052f4@mail.gmail.com>
Message-ID: <4328152F.9060705@statistik.uni-dortmund.de>

Bo Peng wrote:

> Under linux and windows,
> 
> 
>>as.Date("6666-06-06")
> 
> [1] "6666-06-06"
> 
>>as.Date("7777-07-07")
> 
> [1] "1970-01-01"
> 
> 
> Feature? Bug? help(as.Date) does not mention this case.

Well, bug, if you really want to call it a bug that you cannot represent 
the year 6666. ;-)

I guess this is some overflow in do_POSIXlt2D that is not protected 
against misuse. Don't see the point right now, I have to admit.


 > as.Date("6970-12-31")
[1] "6970-12-31"
 > as.Date("6971-01-01")
[1] "1970-01-01"


So we cannot represent more than 5000 years into the future, roughly 
speaking. *Guess* the problem is that we need more than 4 digits for +/- 
5000 years (sum=10000).

Uwe Ligges


> Bo.
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] as.Date() , feature or bug?
Uwe Ligges