?
Solved

problem with localtime

Posted on 1999-01-01
4
Medium Priority
?
449 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 100 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
Six Sigma Control Plans
Suggested Courses

762 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