Solved

problem with localtime

Posted on 1999-01-01
4
442 Views
Last Modified: 2009-07-29
local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime;

I tried the code line above.
but all I got is just something like
  $sec=Time::tmARRAY(...)

What is wrong about this ?
0
Comment
Question by:sn8776
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Expert Comment

by:b2pi
ID: 1207238
There's more to what's going on than what you're showing us.... however, in the first place, use

my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime;


What else is in your code.... Ulpp.  You could also be using an ancient ActiveState
0
 

Accepted Solution

by:
spreq earned 50 total points
ID: 1207239
Try to use this:

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

works for me everytime...
0
 
LVL 84

Expert Comment

by:ozo
ID: 1207240
local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime;
ought to work too. why do you believe you got something like $sec=Time::tmARRAY(...)?
0
 

Author Comment

by:sn8776
ID: 1207241
Solved ... anyway thanks u all.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl strange behaviour 5 77
quoting a comma separated list 20 92
Call Shell Script from Perl Script 6 195
Perl tar error 8 72
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question