Weekly Iteration Suggestion: Working with TIME

One of the biggest pains to me, when coding, is working with time and timezones. Why can’t everyone live in UTC?

The first source of frustration came with learning about the two different timezone libraries: One for ruby: TZInfo and one for rails ActiveSupport::TimeZone.

Then I had these other questions…

  1. Getting Time Data from a User… Do we need to ask for their timezone, or can we trust their computer time and refer the UTC offset from there?
  2. How the crap do you deal with daylight savings time?
  3. What about odd timezones like Indiana where they don’t do daylight savings in part of the state?

For instance, I’m trying to create a reminder app that sends out a reminder once a day at a specific time for multiple users all requesting different times.

Anyways, that’s just the beginning.

TZInfo is a huge help, I think for what you are trying to do. Here is a pretty good 2 parter on the topic of time zones and Ruby:

It’s About Time (Zones)

For getting time zone data from a user, there probably several ways. Here’s one:

If geolocating users, the time zone IDs can be obtained by passing geolocation data to Google’s Time Zone API

I hope this helps!