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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Epoch

Status
Not open for further replies.

Bodhiseed

MIS
Aug 26, 2002
1
US
How can i get Unix to show the epoch time?
Is there a command for it?
 
Hi:

About the closest to a unix command is the GNU date command, normally bundled with Linux. The %s format provides the number of seconds since the EPOCH:

date +%s

You can probably get a copy of GNU date at gnu.org.

A few of the unix-based scripting languages such as perl and TCL have internal functions similar to the stand "C" function time().

Regards,

Ed

 
perl -le'print time()'

perl -e 'print $^T'

# epoch2time:
perl -e 'print scalar localtime 1017705600;' vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top