Getting time in a different time zone

Posted under others On By xpk

These come in handy as I frequently need to know  the time in different timezone.

To get the current time in a different timezone, specify the TZ variable

[bash]
$ TZ=US/Pacific date
Thu Jan  8 17:57:08 PST 2015
[/bash]

To get the time of your choice

[bash]
$ date –date=’TZ=”US/Pacific” 01:00′
Fri Jan 9 17:00:00 HKT 2015
[/bash]

 166 total views,  2 views today

Leave a comment

Your email address will not be published. Required fields are marked *