Solved

problem with localtime

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now