[ale] Perl 5 (localtime) - Y2K issue

Russell Enderby Russell.Enderby at arris-i.com
Thu Sep 2 14:40:46 EDT 1999


That is correct for the calculation but I don't think it accurately describes the year
correctly.  I would expect to get 2001 and not 101.  I could understand 001 but not
101.  Since many programs like MySQL use the full date 101 will throw it off.

I guess the bottom line is if the intention is to get me just the last two digits it
should be 01.  If it is supposed to give me the full date then 2001.  But 101 seems a
bit odd.  Maybe I am the only one with this impression.

Russell

Chris Hamilton wrote:

> > Does anyone know if Perl 5.x is going to fix the localtime problem for
> > y2k?  Currently for the year it just subtracts 1900 from the year.  This
> > will be a major problem and affect CGI's all over.  It is easy to
> > manually fuge it to work but would be nice if a new localtime we updated
> > fixing this in Perl.
> >
> > Anyone know anything about this?
>
> I'm not sure I understand this problem. Once 2000 hits, the year will be
> represented as 100. In 2001, it will be 101 and so forth.
>
> Taken from:
>         "perlfaq4 - Does Perl have a year 2000 problem? Is Perl Y2K     compliant?"
>
>         When gmtime() and localtime() are used in scalar context
>         they return a timestamp string that contains a fully-
>         expanded year. For example, $timestamp =
>         gmtime(1005613200) sets $timestamp to "Tue Nov 13 01:00:00
>         2001". There's no year 2000 problem here.
>
> Continuing ...
>
>         That doesn't mean that Perl can't be used to create non-
>         Y2K compliant programs. It can. But so you can your pencil.
>         It's the fault of the user, not the language. At the risk
>         of inflaming the NRA: ``Perl doesn't break Y2K, people
>         do.'' See http://language.perl.com/news/y2k.html for a
>         longer exposition.
>
> --
> Chris Hamilton          Manager, Information Technology Services
> chrish at realminfo.com    REALM Information Technologies



--
Russell T. Enderby                                        Arris Interactive
Software Engineer                                         3871 Lakefield Dr, Suite 300
Cornerstone Software Development Group   Suwanee, GA 30024-1242
Email: Russell.Enderby at arris-i.com               Phone: 770-622-8490






More information about the Ale mailing list