문제

From my previous question about timezones, I decided to use the Ruby gem tzinfo to get access to time zone data. This means storing scheduled times as a timezone name (e.g. "America/Toronto"), and then using the Ruby tzinfo gem and tzinfo database to look up the correct UTC time from a desired local time.

My understanding is that the database of time zones changes from time to time because different jurisdictions call for different policies on the (non)application of Daylight Savings Time.

Once I install the Ruby gem tzinfo, how do I keep the time zone database up to date?

Also, are time-zones ever dropped from the database?

도움이 되었습니까?

해결책

From tzinfo.rubyforge.org:

 The tz database is compiled into Ruby modules which are packaged in the release.

So just keeping the gem up to date (with gem update tzinfo) should be sufficient to ensure your timezone files are current.

I don't know whether time zones are ever dropped from the database; I've never noticed dropped timezones myself but to be honest I haven't been looking that hard.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top