RE: Perl year

by Rob Prentice <RJP(at)clickdms.com>

 Date:  Mon, 26 Jun 2000 16:14:03 +0100
 To:  "'FODAC(at)aol.com'" <FODAC(at)aol.com>,
hwg-techniques(at)mail.hwg.org
  todo: View Thread, Original
try this...

($second, $minuet, $hour, $dayOFmonth, $month, $year, $weekday,
$dayOFyear, $isDST) = localtime(time);
$realmonth = $month + 1;
$longyear = ($year + 1900);
printf('%02d:%02d:%02d %02d/%02d/%02d', $hour, $minuet, $second,
$dayOFmonth, $realmonth, $longyear);

should work:)

-----Original Message-----
From: FODAC(at)aol.com [mailto:FODAC(at)aol.com]
Sent: 26 June 2000 10:38
To: hwg-techniques(at)mail.hwg.org
Subject: Perl year


I figured out my guestbook erasing problem. I do have one more Perl
question.

I'm using the localtime function for a date when entries are submitted
and I'm getting 20100 instead of 2000 for the year. I reduced the field
size by one and got 205.  This is on a UNIX server. Could someone give
me a brief explanation of how this function works?

Thanks,
Kevin Riggs

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

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.