In a Bash script, I want to print the current datetime in ISO 8601 format (preferably UTC), and it seems that this should be as simple as date -I:
date -I
http://ss
You could use
date "+%Y-%m-%d"
Or for a fully ISO-8601 compliant date, use one of the following formats:
date -u +"%Y-%m-%dT%H:%M:%SZ"
Output:
2011-08-27T23:22:37Z
or
date +%Y-%m-%dT%H:%M:%S%z
2011-08-27T15:22:37-0800