Solved

time command on NT server

Posted on 1998-08-12
9
133 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
Industry Leaders: 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!

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
Rename file based on contents in the file? 3 99
Extract data from span tag 1 96
Perl tar error 8 69
Create an automated page index 9 76
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…
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 …
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…

679 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