As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label timezone. 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.

As some of you may know you can search "time UK" for current local time on Google or Yahoo. I use this feature quite often, but one thing I never couldn't understand is why I can't query by the timezone.

It makes no sense to me. Since it's about time, using timezone as key is so natural to me. When you are participating international events remotely, it is not always have geographical location listed in the time table, timezone abbreviation is most likely to see. Practically, an event often is listed with two or three different local times with respective timezones.

I just don't understand why Google engineers don't get it or, the worst,not even think about it.

Okay, no timezones, fine. Then how about ISO-3166-1 alpha-2/3?
  • "time DE" gets you time in Delaware. I can't really argue about this one, because it's US-regional Google Search.
  • "time DEU" gets nothing.
  • "time GER" gets nothing.
  • "time germ" still nothing.
  • "time germa" still nothing.
  • "time german" frak still nothing.
  • "time germany" yea, finally.
Although "time CET" gets nothing on Yahoo, too, but "time DE" will get you time in Delaware and time in Germany in second line. You can also try "time NL"

Yahoo is smarter when you ask about time. Note that it's not like Google can't give you a list of times regarding the key you use, see "time US".

Maybe time is not so important in Google?

I had thought about writing a web page which can support querying by timezone, but DST is really the pain in the ass and I don't really know how to get accurate DST starting and end information.