[R-SIG-Mac]strptime - Darwin vs Carbon R difference
Jan de Leeuw
deleeuw@stat.ucla.edu
Thu, 14 Nov 2002 22:03:40 -0800
See help(strptime)
If the date string does not specify the date completely, the
returned answer may be system-specific. The most common behaviour
is to assume that unspecified seconds, minutes or hours are zero,
and a missing year, month or day is the current one.
So both are "not incorrect", but the Darwin response is more common. See
also man strptime on Darwin. There is no reason why the two should be
the
same.
On Thursday, November 14, 2002, at 09:11 PM, Greg Jefferis wrote:
> 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
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac@stat.math.ethz.ch
> http://www.stat.math.ethz.ch/mailman/listinfo/r-sig-mac
>
>
===
Jan de Leeuw; Professor and Chair, UCLA Department of Statistics;
Editor: Journal of Multivariate Analysis, Journal of Statistical
Software
US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550; fax (310)-206-5658; email: deleeuw@stat.ucla.edu
homepage: http://gifi.stat.ucla.edu
------------------------------------------------------------------------
-------------------------
No matter where you go, there you are. --- Buckaroo Banzai
http://gifi.stat.ucla.edu/sounds/nomatter.au
------------------------------------------------------------------------
-------------------------