panthomakos / timezone

Accurate current and historical timezones for Ruby with support for Geonames and Google latitude - longitude lookups.
http://rubygems.org/gems/timezone
MIT License
354 stars 49 forks source link

Add `timestamp` parameter for Google #84

Closed AlexWayfer closed 6 years ago

AlexWayfer commented 7 years ago

It's helpful for timezones changes.

Example:

https://maps.googleapis.com/maps/api/timezone/json?location=17.997452,29.609762&timestamp=1458000000

https://maps.googleapis.com/maps/api/timezone/json?location=17.997452,29.609762&timestamp=1510228370

AlexWayfer commented 6 years ago

Hey! Do you need any help in supporting this gem? 🙁

panthomakos commented 6 years ago

Hi @AlexWayfer! I'm always looking for contributors and maintainers. I just got back from vacation today, so I will do my best to look at your PRs over the coming week. Sorry for the delay!

AlexWayfer commented 6 years ago

I just got back from vacation today, so I will do my best to look at your PRs over the coming week. Sorry for the delay!

Okay, thank you!

I'm always looking for contributors and maintainers.

Examine my PRs (some of them depend on others, alas) and you can consider my candidacy, I'll try to help as far as I can.

AlexWayfer commented 6 years ago

It appears that the URL parameter does not impact the timeZoneId value which is the only value we care about.

What about offsets? Timezone::Zone#utc_offset, for example.

panthomakos commented 6 years ago

What about offsets? Timezone::Zone#utc_offset, for example.

The offset value is calculated based on the time at which the offset is being requested (i.e using the tzdata database and the input time). We don't need an HTTP request to calculate that value.

AlexWayfer commented 6 years ago

The offset value is calculated based on the time at which the offset is being requested (i.e using the tzdata database and the input time). We don't need an HTTP request to calculate that value.

Maybe we should take the offset from API reponse? (Google and GeoNames have these fields)

panthomakos commented 6 years ago

Maybe we should take the offset from API reponse? (Google and GeoNames have these fields)

If the gem only provided an interface to Geonames/Google then I think that would be okay, but with the ability to calculate the timezone offsets offline there is no reason to retrieve or use the offset data from the API. If every offset or time conversion request needed to make an API call, the gem would not be very performant.

AlexWayfer commented 6 years ago

OK, let's close it (for now).