Gossamer Forum
Home : Products : DBMan : Discussions :

getting current time

Quote Reply
getting current time
Hi all,

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
Subject Author Views Date
Thread getting current time caryhung 3421 Apr 8, 2002, 3:20 AM
Thread Re: [caryhung] getting current time
Paul 3363 Apr 8, 2002, 7:34 AM
Post Re: [Paul] getting current time
caryhung 3352 Apr 8, 2002, 9:31 PM