[R-SIG-Mac]strptime - Darwin vs Carbon R difference

Greg Jefferis jefferis@stanford.edu
Thu, 14 Nov 2002 21:11:19 -0800


I am using both the carbon(v1.60) and Darwin (r-base 1.6.1 fink updated
today) versions of R with MacOS X 10.2.  I find that there seems to be a
problem with strptime under Darwin - if a bad date is passed it returns
today's date instead of NA.

Carbon R:

> strptime("10/2/2001",format="%d/%m/%Y")
[1] "2001-02-10"
> strptime("",format="%d/%m/%Y")
[1] NA


Darwin R:
> strptime("10/2/2001",format="%d/%m/%Y")
[1] "2001-02-10"
> strptime("",format="%d/%m/%Y")
[1] "2002-11-14"

I presume that this a problem with some external library.  Would anyone be
able to suggest a fix?

Thanks,

Greg.


__________________________________________________________________________
Greg Jefferis,                          Lab Address: Liqun Luo, Herrin 144
Neurosciences PhD Programme &                e-mail: jefferis@stanford.edu
Dept Biological Sciences,                       Lab: (650) 725 5809
Gilbert Biology Building,                       Fax: (650) 723 0589
371 Serra Mall,
Stanford, CA 94305-5020.                       Home: (650) 326 9597