Solved

time command on NT server

Posted on 1998-08-12
9
129 Views
Last Modified: 2010-03-05
When I request the time

$t1 = time;
print $t1;
I get a number like  902976430
What does this mean?  It appears to be in seconds, but from where?
0
Comment
Question by:donb1
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 5

Expert Comment

by:b2pi
ID: 1209248
try

perldoc -f time

Should be number of seconds since the first second of 1970 (I think that's the case on NT...)

You might rather deal with localtime or gmtime

0
 

Author Comment

by:donb1
ID: 1209249
That was not an answer to my question!
0
 
LVL 84

Expert Comment

by:ozo
ID: 1209250
#it sounded like an answer to me.
#Perhaps you should clarify your question.

print scalar gmtime 902976430;
#will tell you what it means

print scalar gmtime 0;
#will tell you where the count is starting from
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 2

Expert Comment

by:Biffo
ID: 1209251
Why don't you just get the time from the $ENV, lot easier :)


0
 
LVL 2

Accepted Solution

by:
Biffo earned 50 total points
ID: 1209252
Anyways, to answer your question, your sample is returning
the number of non-leap seconds since 00:00:00.

Biffo
0
 

Author Comment

by:donb1
ID: 1209253
OK - what happens to the number in about 3 years when the number gets to a billion?  does it show up as 000000000 or 1000000000?  Is this another y2k +  bug?
0
 
LVL 84

Expert Comment

by:ozo
ID: 1209254
I'm not sure what makes Biffo's answer acceptable while b2pi's wansn't.
I must still not be understanding the question.

But to can see what happens in about 3 years
 print scalar localtime time+3.1*365*24*60*60;
0
 

Author Comment

by:donb1
ID: 1209255
I probably goofed in rejecting b2pi's answer.  His "I think" threw me off, I guess and also the rather answers.  His answer was OK, just my misunderstanding of it.  Guess there is no way to undo the thing.
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1209256
I'm sure in the future I'll try to downplay my use of the English language.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
cpan issue 1 63
perl to display a matrix report for 3-dimenional array 3 67
git fat pull happens nothing in centos 6.3 python 2.6.6 33 216
add a syntax to a csv file 8 99
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

776 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