When I cat the file an example of the output format is:
ok: servername Mon May 23 00:00:00 EDT 2018
ok: servername Thu Jul 16 00:00:00 EDT 2019
According man date
, the command is able to
display time described by STRING, not 'now'
via --date
or -d
. So if you store your values in a variable
DATE="Thu Jul 16 00:00:00 EDT 2019"
you could use something like
date --date="${DATE}" +%m/%d/%Y
to reformat the timestamp.
For more information you may have a look into Convert date formats in bash.