date unix command
date reports the date and time to stdout.
Timezone
Section titled “Timezone”To pick the timezone, you can set the TZ variable before you print the date. e.g.
$ TZ=Australia/Sydney dateThu, Jun 28, 2012 7:53:33 AM
$ TZ=America/New_York dateWed, Jun 27, 2012 5:53:34 PMIf you are automating scripts then you can use UTC timezone to avoid issues when migrating your script between
environments. Use the -u option for this.
$ date -uWed, Jun 27, 2012 9:54:27 PMFormatting
Section titled “Formatting”There are lot of formatting options available. As a guide you can use the following format to display everything from year to seconds.
$ date -u "+%Y-%m-%d %k:%M:%S"2012-06-27 21:56:49