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
Just use normal date formatting options:
date
date '+%Y-%m-%d'
Edit: to include time and UTC, these are equivalent:
date -u -Iseconds date -u '+%Y-%m-%dT%k:%M:%S%z'