As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label world clock. Show all posts

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. 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/Pacific
Europe/Berlin
Chile/Continental
new york
Los Angeles
A snapshot of output looks like:
US/Pacific           2012-06-14 17:10:57 PDT
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
There 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.

2011-02-28--20:46:39Yesterday, I made these in text file with Unicode Box-drawing characters. I like the last two styles, so I finished a full set.

A set of clocks in terminal, how cool is that?

I don't know but I don't really need to know when people get up around the world. So, this is just an idea, I didn't start writing this program. I have also tried to find some programs but I didn't find a world clock program which I visualized. But I found this question on StackOverflow, which have some commands that list clocks. They are simple clock, just print out the time.



I think with colors for day and night, it will be a nice way to tell A.M. or P.M. Also colors in location text can indicate time ahead or behind the current local time.

Another idea is flip clock. Yes, flip clock in terminal, I believe is doable. I have written a Chrome Extension, which also works on Firefox. You can see the main file, use Space or 2 to switch mode, or double-click on clock.

I think it's possible to emulate with 256-color, maybe that would already work in 16-color? Making a bigger clock text with boxes, I truly believe it will look like flipping.

Anyway, they are just ideas. I am not gonna implement them, because I know I won't be a user of them. But if you want to have them, you really need such program, please let me know. I will finish for you.

If you know any programs already do what I described, leave me a link, I would like to check them out. If you want to ask why not just use web app or GUI program? Why? Let me tell you this "The answer is simple, because we can make it."

Where I really want to have these fonts is in tmux clock mode.