On 02/02/15 09:27, Pádraig Brady wrote:
On 02/02/15 16:41, Chris Lamb wrote:
We are currently in a funny situation where GNU date can't parse its own
output:

   $ date --date="$(date)"
   date: invalid date ‘Mon  2 Feb 16:37:46 GMT 2015’

I don't think this will work as the output from date(1) is ambiguous.
For example locales change change the output order, and names.
In your example, date(1) can parse US locale default format, but not UK:

$ date -d"$(LC_TIME=en_GB date)"
date: invalid date ‘Mon  2 Feb 17:23:25 GMT 2015’

It would still be useful to make the ways for doing this more readily known.
e.g. in examples:

  touch -t $(date --date @$(( $(date +%s) + 10 )) +%Y%m%d%H%M.%S) file

set the modify time of "file" to 10 seconds from now.  It's a little obtuse.

Reply via email to