At 00:23 2001.06.27, Jeff 'japhy' Pinyan wrote:
>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.

I've found time2iso() from HTTP::Date simple to use and reliable across OS. There is 
also a parse_date() function that might be helpfull for you.


-----------------------------------------------------------
Éric Beaudoin                <mailto:[EMAIL PROTECTED]>

Reply via email to