[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Y2K complience



localtime() returns a 2 digit year in all systems under perl, as far as I
can gather.  I'm not sure what the reprecussions of this are when the year
2000 rolls around, but I note that localtime, can, at least on UNIX
systems, return a 4-digit year when localtime is evaluated in a scalar
context:

	my $str = localtime;
	print $str, "\n";

The above outputs "Wed Jun 18 08:28:50 1997" for me...

The perl manpage under unix says that the year value comes straight out
of a tm structure (ok, all of the values...), and upon looking up 'man
localtime' on Solaris, it popped up a description of the year field in a
tm structure.  It seems to be set to the current year minus 1900.  So, I
presume that on the year 2000, you'll get "100" in the year position from
localtime, and in 2001, you'll get 101, in 2002, you'll get 102, etc...

-David

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
       David T. McWherter     dtm@waterw.com
 Mach Kernel Hacker's WWW Page: 
          http://www.waterw.com/~dtm/mach/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

On Wed, 18 Jun 1997, Tony Barry wrote:

> I just noticed that a localtime  returns a two digit year.  Is MacPerl Y2K
> complient?
> 
> Tony
> 
> _______________________________________________________
> mailto:tony@ningaui.anu.edu.au          |+61 6 249 5688
> http://www.anu.edu.au/People/TonyB.html |+61 6 288 0959
> 
> Ningaui Pty Ltd, GPO Box 1680, Canberra City,  ACT 2601
> 
> Visiting Fellow, Department of Computer Science,   FEIT
> Australian National University,    ACT 0200   AUSTRALIA 
> 
> 
> 
> ***** Want to unsubscribe from this list?
> ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch
> 


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch