Example code:

#!/usr/bin/perl -w
select(STDOUT); $| = 1; # make unbuffered

use Time::Local;

 $tdate = "31/03/2011";
 $ttime = "14:49:59";
 $mday  = $mon = $year = 0;
 $hour = $min = $sec = 0;

 ($mday,$mon,$year) = split('/',$tdate);
 ($hour,$min,$sec)  = split(':',$ttime);
print "mday =  $mday \tmon = $mon\tyear = $year\n";
print "hour =  $hour \tmin = $min\tsec = $sec\n";
        $uxtsec = timelocal($sec,$min,$hour,$mday,$mon,$year);
print "timelocal_sec = $uxtsec\n";
#-------------------------------------------------------------------#

Result:

$ ./tl.pl
mday =  31      mon = 03        year = 2011
hour =  14      min = 49        sec = 59

Error:       Day '31' out of range 1..30 at ./tl.pl line 15


Is there a bug? The 'mday' range in the doc says 1..31 and it is 31 here. But 
complains about out of range.


Thanks,


Dr. Nachi Nithi
Bell-Labs, Alcatel-Lucent
2C-323, Mountain Ave.,
Murray Hill, NJ 07974
Ph: 908-582-3590
Home: 
http://ect.bell-labs.com/who/karun//index.html<http://ect.bell-labs.com/who/karun/index.html>
-------------------------------------------------------------------------------------------------------------------------------------------------


Reply via email to