I had some issue with Google when querying about current time in different zone. Despite that, it seems too lazy if you can do in your own terminal.
I found an answer of having world clock using a simple Bash script, and I expanded it a little more, the Gist:
If run
date
command can achieve that with environment variable TZ
, but you need to use perfect match timezone string, which you can found at /usr/share/zoneinfo/posix
.I found an answer of having world clock using a simple Bash script, and I expanded it a little more, the Gist:
If run
cliclock.sh testzones cet
and testzones
file contains:US/PacificA snapshot of output looks like:
Europe/Berlin
Chile/Continental
new york
Los Angeles
US/Pacific 2012-06-14 17:10:57 PDTThere are more to improve this script, such as options to add or to remove a zone. You can press Q to quit this script elegantly, so a few more lines should be enough to accept some additional zone since there is already a function for checking validity of input zone name. It can't recognize country codes, but it'd not be a huge task to add a group of zones associated to a country code.
Europe/Berlin 2012-06-15 02:10:57 CEST
Chile/Continental 2012-06-14 20:10:57 CLT
America/New_York 2012-06-14 20:10:57 EDT
America/Los_Angeles 2012-06-14 17:10:57 PDT
CET 2012-06-15 02:10:57 CEST
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.