You are right. I thought it was something more because I got an error:
Can't locate object method "hours" via package "Time::tm" (perhaps you forgot to load "Time::tm"?) at ./GetDate.pl line 4. I was also using the Orielly Perl CookBook 2nd Edition and it specifies $hours and not $hour. This is very frustrating for a beginner when the text book is wrong. Thank you very much for the help. DA On 7/19/05, Wiggins d'Anconia <[EMAIL PROTECTED]> wrote: > Dave Adams wrote: > > I can get date but not time. > > > > use Time::localtime; > > $tm = localtime; > > printf("Current date: %04d-%02d-%02d\n",$tm->year+1900,($tm->mon)+1, > > $tm->mday); > > printf("Current time: %02d:%02d:%02d\n",$tm->hours,$tm->min,$tm->sec); > > The above should include $tm->hour instead of $tm->hours, but were you > not getting the min/sec before? > > > > > Any help would be appreciated. > > DA > > > > http://danconia.org > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>