Solved

problem with localtime

Posted on 1999-01-01
4
434 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Perl - Mawk 2 101
collecting information 2 184
Perl string filter 5 82
What does msixpodualn stand for and how do I read this "qr/STRING/msixpodualn"? 4 96
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 …
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…

828 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