Re: Perl year

by Joerg Plate <Joerg(at)Plate.cx>

 Date:  26 Jun 2000 18:29:26 +0200
 To:  <hwg-techniques(at)mail.hwg.org>
 References:  hwg
  todo: View Thread, Original

> I'm using the localtime function for a date when entries are
> submitted and I'm getting 20100 instead of 2000 for the year.

RTFM

1> perldoc -f localtime
...
Also, C<$year> is the number of years since 1900
...

Wrong:  printf "20%d", $year;
Right:  printf "%4d", $year+1900;

-- 
"I'm working on it."  <http://www.psyche.cx/> SMS:01777476800

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