I have an hour variable in shell that contains UNIX time in seconds.
Then If want to format this hour, I use
date -u -d @$hour +"%Y-%m-%dT%H:%M:%S.000Z"
which works. However, I want to store the result of the above expression to another variable, so when I do:
formatted=$(( date -u -d @$hour +"%Y-%m-%dT%H:%M:%S.000Z" ))
it does not work. I do not know how will I reference the hour variable within an evaluation expression (whatever it is called).