GithubHelp home page GithubHelp logo

tzinfo-data's Introduction

TZInfo::Data - Timezone Data for TZInfo

RubyGems Tests

TZInfo::Data is the public domain IANA Time Zone Database packaged as a set of Ruby modules for use with TZInfo.

If TZInfo::Data is installed, TZInfo will automatically use it as its source of time zone data. If TZInfo::Data is not available, TZInfo will attempt to use the system zoneinfo files instead. Please refer to the TZInfo documentation for further details.

Installation

The TZInfo::Data gem can be installed by running:

gem install tzinfo-data

License

TZInfo::Data is released under the MIT license, see LICENSE for details.

Timezone data is based on the public domain IANA Time Zone Database.

Source Code

Source code for TZInfo::Data is available on GitHub.

Issue Tracker

Please post any bugs, issues, feature requests or questions to the GitHub issue tracker.

tzinfo-data's People

Contributors

philr avatar rennex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tzinfo-data's Issues

Supporting SystemV time zones

I noticed that systemv time-zones are not included. We need to support some machines that still use these deprecated time-zones and I was wondering what's the rationale behind not including them and if it would be possible to add support for them in tzinfo-data.

"The dependency tzinfo-data will be unused" on Ubuntu

When I run "rails new appname" command I get this message

The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform mingw, mswin, x64_mingw, jruby.

I've tried
gem install tzinfo-data

but it didn't help.
I've also tried bundle lock --add-platform mingw, mswin, x64_mingw, jruby as the message suggested but it only works for particular app and every time I create a new app I see the message again.

Ubuntu 14.04,
Ruby 2.3.3, Rails 5.0.1

cant update tzinfo-data

Downloading tzinfo-data-1.2013.8 revealed dependencies not in the API or the lockfile (tzinfo (>=
1.0.0)).
Either installing with --full-index or running bundle update tzinfo-data should fix the problem.

In Gemfile:
tzinfo-data

GitHub Pages website out of date

Hi!

I took a look at the gemspec, and saw the homepage specification attribute was using "http", so I visited it, and saw that it supported "https". Was about to update the attribute, but saw the gem version badge presented by GemFury there.

  • On the repo's rendered README, it's the current one, 1.2 something
  • On the homepage in GitHub Pages, it's 2.0.1 - misleading

The homepage information could perhaps be turned into information in the README, if the website is not to maintained (there's no specific Git branch for the website, which is common with GitHub Pages websites).

Do you want to keep the homepage around?

Deprecated time zones.

Hi. Thanks for this amazing project as it saves us from many headaches.

The miniature issue/inconvenience I am having is that there is no zone attribute to help with eliminating backward compatible time zones. I am interested in displaying all time zones except for deprecated ( https://en.wikipedia.org/wiki/List_of_tz_database_time_zones ). I see a big incidence between deprecated time zones and the ones listed in IANA Time Zone Database backward file but not complete for example US/Pacific-new or WET.

So my question would be - is there any sense in adding a flag to the time zone data to indicate that the zone is only for backward compatibility.

Invalid result when formatting time zone as hour and minute offset from UTC

Formatting time zone object using abbreviated time zone name (%Z) seems to work just fine, however formatting it as hour and minute offset from UTC (%z) appears to return an invalid result. See an example below, I would expect to get -05:00 rather than +00:00:

2.1.8 :001 > tz = TZInfo::Timezone.new('America/Chicago')
 => #<TZInfo::DataTimezone: America/Chicago>
2.1.8 :002 > tz.strftime('%Z')
 => "CDT"
2.1.8 :003 > tz.strftime('%:z')
 => "+00:00"

Is this problem related to your code, or is it dependent on specific environment settings and/or ruby installation? If the latter is the case, do you know any workaround to address it? Many thanks!

Thank you!

Hi @philr, just wanted to thank you for this package, couldn't find you on twitter.

I'm trying to resolve the problem when a new version of tzdata is released, so I made a couple of things:

  1. a ruby package that contains each version of the database in JSON files, and can return the diff (for ex: what do I have to check in my system if I'm in 2016c and install 2017a, for America/Santiago and America/Punta_Arenas). I extracted all the data from your tzinfo-data gem.
  2. a npm package that uses the json data generated above, and do the same in javascript.
  3. a demo to see the changes, for example: here you can see the changes above for America/Santiago โ†’ America/Punta_Arenas.

I will post a medium post later on the topic, but thanks again for your work.

Kazakhstan TZ change

The Feb 2024a release notes mentions:

Kazakhstan unifies on UTC+5. This affects Asia/Almaty and Asia/Qostanay which together represent the eastern portion of the country that will transition from UTC+6 on 2024-03-01 at 00:00 to join the western portion.

When is the data expected to be updated/released with this change?

No source of timezone data could be found. (TZInfo::DataSourceNotFound)

With RailsInstaller 3.1.0 (Ruby 2.1) on Windows 2008 Server (32bit) I can't start my rails server because of the following error:

D:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/tzinfo-1.2.2/lib/tzinfo/data_source.rb:182:in rescue in create_default_data_source': No source of timezone data could be found. (TZInfo::DataSourceNotFound)`

In my Gemfile I am using the following entry for tzinfo-data:

gem 'tzinfo-data', '= 1.2016.1', platforms: [:x64_mingw, :mingw, :mswin], path: 'C:\Temp'

Note here that my server does not have any connection to outside that's why I specified the path in the Gemfile, where I have downloaded and stored the following gem: tzinfo-data-1.2016.1.gem

test failure

Hi, I'm attempting to package tzinfo-data for Guix, and ran into this test failure. Any ideas?

  1) Failure:
TCDefinitions#test_all [/tmp/nix-build-ruby-tzinfo-data-1.2016.4.drv-0/tzinfo-data-1.2016.4/test/tc_definitions.rb:55]:
Local times don't match:
zdump:         Africa/Casablanca 2037-10-25T01:59:59+00:00 UTC 2037-10-25T02:59:59+00:00 WEST is_dst=1
tzinfo (u->l): Africa/Casablanca 2037-10-25T01:59:59+00:00 UTC 2037-10-25T01:59:59+00:00 WET is_dst=0.
--- expected
+++ actual
@@ -1 +1 @@
-#<DateTime: 2037-10-25T02:59:59+00:00 ((2465357j,10799s,0n),+0s,2299161j)>
+#<DateTime: 2037-10-25T01:59:59+00:00 ((2465357j,7199s,0n),+0s,2299161j)>


10 runs, 153467 assertions, 1 failures, 0 errors, 0 skips

Thanks.

TZInfo::AmbiguousTime: 1895-12-31 23:59:59 UTC is an ambiguous local time. (Asia/Taipei)

I have a Rails app that defaults time zone to "Asia/Taipei" (UTC+8). Sometimes an exception like this would be raised:

TZInfo::AmbiguousTime: 1895-12-31 23:59:59 UTC is an ambiguous local time.

With tzinfo 0.3.37 (which Rails depends on), this exception can be reproduced in irb:

> time = Time.new(1895,12,31,23,59,59)
 => 1895-12-31 23:59:59 +0800

> TZInfo::Timezone.get("Asia/Taipei").local_to_utc(time)
 => TZInfo::AmbiguousTime: Time: 1895-12-31 23:59:59 UTC is an ambiguous local time.

> TZInfo::Timezone.get("Asia/Shanghai").local_to_utc(time)
 => 1895-12-31 15:54:02 UTC

Both Asia/Taipei and Asia/Shanghai are in UTC+8 today, and have no official time zone in 1895.

This issue does not happen if I load tzinfo 1.0.1, which uses TZ Database directly from OS. If I install both tzinfo 1.0.1 and tzinfo-data gems, this issue would happen again (in this case tzinfo takes tzinfo-data instead of OS-provided TZ DB). However Rails binds version of tzinfo to >= 0.3.37, so I cannot work around this by simply upgrading tzinfo to 1.0.x.

I confirmed that such exception would happen if the local time to convert is between 1895-12-31 23:54:00 and 1895-12-31 23:59:59, and noticed that, in the original TZ Database, the following definition exists:

# Zone  NAME        GMTOFF  RULES   FORMAT  [UNTIL]
Zone    Asia/Taipei 8:06:00 -       LMT     1896 # or Taibei or T'ai-pei
                    8:00    Taiwan  C%sT

I want to make sure:

  • Which is the expected behavior? Ambiguous time? Or correctly converted like Asia/Shanghai?
  • Is there a rare case that is not handled in the converter of tzinfo-data?

Thanks.

Invalid DST timestamp for America/Santiago time zone.

Versions 1.2022.1, 1.2022.2 and 1.2022.3 incorrectly determine the DST timestamp for the time zone America/Santiago. This affects 2022 and 2024 years. Gem defines the timestamp as the second Sunday in September, although the correct value is the first Sunday in September. Version 1.2021.5 does not give this error.
I want to note that this works correctly for 2021, 2023, 2025, and also for the spring forward.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.