Solved

time command on NT server

Posted on 1998-08-12
9
126 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
 
LVL 2

Expert Comment

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


0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question about @INC variable in perl 1 55
Perl string replace for refred url 9 59
Perl Awk Need Help 3 109
batch script for automated email 12 101
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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

21 Experts available now in Live!

Get 1:1 Help Now