[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils don't accept time_t value
From: |
Eric Blake |
Subject: |
Re: coreutils don't accept time_t value |
Date: |
Thu, 04 May 2006 03:43:49 +0000 |
> It used to be possible with the coreutils to convert a time_t value, as
> produced by date +%s, back into a time which can be used by date and
> touch:
It still is. The info pages ("info coreutils date") recommend:
To convert such an unwieldy number of seconds back to a more
readable form, use a command like this:
# local time zone used
date -d '1970-01-01 UTC 946684800 seconds' +"%Y-%m-%d %T %z"
1999-12-31 19:00:00 -0500
Or, see "info coreutils 'seconds since'" where you will see the
new, shorter syntax for seconds since the epoch is:
date -d @946684800
Fri Dec 31 17:00:00 MST 1999
>
> > date -u -d "70-1-1 00:00:`date +%s`"
> date: invalid date `70-1-1 00:00:1146711463'
> > date --version
> date (GNU coreutils) 5.3.0
5.3.0 was an unstable release. Consider upgrading to the
latest stable release, 5.94.
--
Eric Blake