The date command and ISO 8601 date+time representations

by

8601 provides a variety of interesting format variations. I routinely wish to use, but can never remember, the following:

$ TZ=UTC date +%Y-%m-%dT%H:%M:%SZ
2009-10-29T04:10:09Z
$ date +%Y-%m-%dT%H:%M:%S%Z
2009-10-29T12:10:43SGT
$

Recorded here for easy reference next time.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: