What does the value of at-sign @ mean in the bash command: date -date @ ...?

Searching the Internet I found explanations only for '$ @', which means expand to positional parameters. But I could not find anything about the @ sign.

I came across him in the third separation from the accepted answer to this question: https://superuser.com/questions/611538/is-there-a-way-to-display-a-countdown-or-stopwatch-timer-in- a-terminal

In particular:

date -u --date @$((`date +%s` - $date1)) +%H:%M:%S
+4
source share
1 answer

In the context you have shown, it @is at the beginning of the argument to the --datecommand date:

date -u --date @$((`date +%s` - $date1)) +%H:%M:%S

In this case, this means that the argument should be considered as the number of seconds since the era, see the example in man date:

(1970-01-01 UTC)

$ date --date='@2147483647'

$ date -u -d @0
Thu Jan  1 00:00:00 UTC 1970

@ date, bash.

+4

All Articles