date

Table of Contents

date reference

date -u
#     └─ --utc
# Fri Aug 18 06:57:31 UTC 2017

date -R
#     └─ --rfc─2822
# Fri, 18 Aug 2017 15:55:42 +0900

date '+%Y%m%dT%H%M%S'
# 20170818T144038

TZ='America/Los_Angeles' date
# Fri Aug 18 00:01:11 PDT 2017

date -d '2days ago'
#     └─ --date, display time described by STRING, not 'now'
# Wed Aug 16 16:05:03 KST 2017

date -d '2days ago' '+%Y%m%dT%H%M%S'
# 20170816T160622

date --iso-8601
# 2017-08-18

date --iso-8601=seconds
#                    └─ also can be 'auto', 'hours', 'minutes', 'ns'
# 2017-08-18T17:12:30+09:00

date --utc --iso-8601=seconds
# 2017-08-18T08:12:49+00:00