Join GitHub today
Reverse lookup? #22
Hi, I hope it's okay to ask a question here. I was going to post to the mailing list, but rubyforge seems to be gone.
I'd like to find the zone identifiers where the local time is a certain time. For example, in which zones is it currently 6pm?
The best I could come up with on my own was to look at all zones and check the time in each one. Is there another way to do this? I've been browsing http://rubydoc.info/gems/tzinfo/TZInfo without much luck. Any ideas or suggestions on where to read on rubydoc would be great. Thanks!
There's nothing in TZInfo that will do what you want directly.
Depending on exactly how you want to handle daylight savings transitions, your best option might be to calculate and store the offset of each time zone and use this to group the time zones you are interested in.
This will give you the base offset from UTC in seconds for