Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When was something created? 108965770 seconds since 1970 2

Status
Not open for further replies.

Autosys

Programmer
Jun 1, 2004
90
GB
Hi,

I'm farely new to Unix and need to track down when an entry was placed in a database.

I know it was 108965770 second after the year 1970. Has anyone ever written a script to work something like this out and display the value in a normal date time fasion?

Your help will be very much appreciated!

Thanks!

S
 
Code:
#!/usr/bin/perl -w
use strict;
my $arg = shift;
print scalar localtime($arg), "\n";

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L

 
A year is 31536000 seconds. Leap year is 31622400 seconds. If your numbers are correct, looks like 1973 sometime.

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top