Reputation: 11
I need to retrieve the current time in seconds in a old machine (bash version 4.3) and this command is not working.
date +%s
It retrieves "%s" Any idea of what is wrong here?
Upvotes: 0
Views: 329
nawk 'BEGIN {srand();time=srand();print time}' </dev/null
Upvotes: 1
Reputation: 7277
Try with printf function.
printf
$ printf '%(%s)T' -1 1635846449