ISO Date

The purpose of this document is to show how to get an ISO 6801 date.

iso_date=$( date +'%Y-%m-%d' ) * 2013-03-29 iso_date=$( date --rfc-3339=seconds) * 2013-03-28 20:14:38-07:00 iso_date=$( date --rfc-3339=seconds --utc) * 2013-03-29 03:14:48+00:00

The now() function:

function now() { now=$(date --iso-8601=seconds --utc) echo "$now" } echo "At this time it is $(now)." # function now() { now=$(date --iso-8601=seconds --utc) ; echo "$now" }

Here's one that works well in a filename:

$(date +'%Y-%m-%d_%H%M%S' --utc) * 2013-12-02_005831

[Edit]