When I didn’t trust my mental ability to convert dates and times, I relied on online tools like http://worldtimeserver.org/, but this task can easily be done from the command line (and without an internet connection). For instance, I am now in Taipei, and I want to know what time it will be here when it is 4:30pm in Pacific time. A quick search revealed the following use of the `date` command:
1 2 | date --date='TZ="America/Los_Angeles" 2012-9-17 16:30' Tue Sep 18 07:30:00 CST 2012 |
Using the date, it will also consider daylight saving’s time. Compare it with:
1 2 | date --date='TZ="America/Los_Angeles" 2012-12-17 16:30' Tue Dec 18 08:30:00 CST 2012 |
Now I see there is an example if the man-documentation of `date`, along with other options.
[UPDATE]
The above only converts from some other timezone to the one your shell is set to. If you want to go the other way around, you need to change the timezone (temporarily) when the command is run. For example, if you are in the Pacific timezone and want to convert a time to Singapore time, do the following (all on one line):
1 | TZ=":Singapore" date --date='TZ="America/Los_Angeles" 2013-04-02 16:30' |