On Jun 27, Walt Mankowski said:

>On Tue, Jun 26, 2001 at 10:53:12PM -0500, Steve Howard wrote:
>> I would suggest using the localtime function. That will work regardless of
>> OS.
>> 
>> ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
>> localtime(time);
>> ($mon, $year) = ($mon+1, $year+1900);
>
>That doesn't quite work, since %m and %d zero-pad their values.  If
>you just need the date in one variable, call localtime as above, then
>use sprintf to format them correctly:

Or use the POSIX::strftime() function, which uses its own %X formats to
create a date string.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **

Reply via email to