1825784 Members
2142 Online
109687 Solutions
New Discussion

Re: Epoch Time

 
Greg Stark_1
Frequent Advisor

Epoch Time

Does anyone know of a Unix command that will return the current epoch time. I looked at date, but I don't see that it is an option for epoch.

Thanks in advance,
Greg
2 REPLIES 2
Vincenzo Restuccia
Honored Contributor

Re: Epoch Time

See time(1), date(1) , gettimeofday(2) , stime(2) , ctime(3C) , strftime(3C) .
A. Clay Stephenson
Acclaimed Contributor

Re: Epoch Time

Hi Greg,

Probably the easist method is to create a
very small perl script e.g. time.pl.

Nothing more than
printf("%d\n",time());

then your shell script can do this
SECONDS=`perl time.pl`

That's it, Clay
If it ain't broke, I can fix that.