Hi all,
After reading Perl Cookbook, I found the following codes for getting current date:
$tm = localtime;
($DAY, $MONTH, $YEAR) = ($tm->mday, $tm->mon, $tm->year);
However, I cannot get the current time by using the following codes:
$tm = localtime;
($myseconds, $myminutes, $myhours, $myday, $mymonth, $myyear) = ($tm->sec, $tm->min, $tm->hours, $tm->mday, $tm->mon, $tm->year);
print ("$myseconds\n", "$myminutes\n", "$myhours\n", "$myday\n", "$mymonth\n", "$myyear\n");
Any suggestion?
Cary
After reading Perl Cookbook, I found the following codes for getting current date:
Quote:
use Time::localtime; $tm = localtime;
($DAY, $MONTH, $YEAR) = ($tm->mday, $tm->mon, $tm->year);
However, I cannot get the current time by using the following codes:
Quote:
use Time::localtime; $tm = localtime;
($myseconds, $myminutes, $myhours, $myday, $mymonth, $myyear) = ($tm->sec, $tm->min, $tm->hours, $tm->mday, $tm->mon, $tm->year);
print ("$myseconds\n", "$myminutes\n", "$myhours\n", "$myday\n", "$mymonth\n", "$myyear\n");
Any suggestion?
Cary