[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] Need to convert standard time to epoch in bash

On Tue, 2007-04-17 at 11:10 -0400, David Tomaschik wrote:
> This requires GNU date, but is fairly simple:
> date '+%s'

That is a good point.  I assume he wanted to pass a time to a function
and convert to an epoch.  I do this all the time when comparing dates.

For example I'll take a Meridian PBX's time that is displayed and
convert to an epoch value.  I'll then compare that to the server.  If
the values are off by more than 60s I notify a technician to set the
time on the PBX.  These PBX systems do not support NTP but Linux does.