Re: Y2K problem in Perl

by Jeff Diaz <jdiaz(at)ivtech.com>

 Date:  Tue, 06 Jun 2000 10:32:32 -0400
 To:  Romek aka webadmin <www(at)wipos.p.lodz.pl>,
hwg-languages(at)hwg.org
 References:  mediaone hotmail
  todo: View Thread, Original
Not exactly a Y2K problem as a feature.  The year is returned as the number 
of years since 1900.  So simply add 1900 to your $year and you'll get the 
proper result.

  - Jeff

At 09:33 AM 6/6/00, Romek aka webadmin wrote:
>Hi,
>
>I have got this Perl subroutine which returns date
>as  5 Jul 100  instead of  5 Jul 2000
>
>Can anybody correct this to return date in proper
>format without reconfiguring server ?
>
>BTW  the Perl interpreter is rather old on this server
>      so please do not use 5.0.x specific instructions.
>
>sub Last_Modified
>#  This wonderful snippet was written by Jeff Carnahan of
>#  Terminal Productions (www.terminalp.com)
>{
>$filename = shift;
>($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
>localtime((stat($filename))[9]);
>@months = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);
>return "$mday $months[$mon] $year";
>}
>
>
>
>--
>Romek Zylla
>~~~~~~~~~~~  after all the work done by Micro$oft (R)  ~~~~~~~~~~
>         Personal Computer Science is an experimental one (C)
>        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA