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
Quote Reply
Re: [caryhung] getting current time In reply to
Check out post 3:

http://www.gossamer-threads.com/...rum.cgi?post=187737;

Last edited by:

Paul: Apr 8, 2002, 7:34 AM
Quote Reply
Re: [Paul] getting current time In reply to
Hi Paul,

I've solved the problem. Thanks a lot.

CarySmile