touch commands (and presumably others) use
@date to define a date string as seconds since the epoch. For example:
$ TZ=UTC date -d@10 Thu Jan 1 00:00:10 UTC 1970
I was answering a question and wanted to point the OP to where this particular feature was documented but I can't find it. Neither
man date not
man touch explain it. The closest is this from the "Examples" section of the
date man page:
Convert seconds since the epoch (1970-01-01 UTC) to a date $ date --date='@2147483647'
info page for
date states that this was introduced in
coreutils 5.3.0, but does not really explain it further either:
Or if you do not mind depending on the `@' feature present since coreutils 5.3.0, you could shorten this to: date -d @946684800 +"%F %T %z" 1999-12-31 19:00:00 -0500
So, where is
@seconds documented? Where am I supposed to learn about it and where can I point someone who does not? Is that off-hand mention in
man date really the best we have?