Skip to main content

date

Format

$ date '+%Y-%m-%d %H:%M:%S.%N'
2019-12-04 14:27:59.372201900

Some OS like alpine does not support milliseconds

Timezone

$ TZ=Asia/Taipei date '+%Y-%m-%d %H:%M:%S'
2019-12-04 14:27:59

If TZ not works, install tzdata