ruby / date

A subclass of Object includes Comparable module for handling dates.
Other
70 stars 35 forks source link

CAT timezone is parsed as -10:00 instead of +02:00 #25

Closed geophilusd closed 3 years ago

geophilusd commented 3 years ago

Ruby version 2.7.1 https://www.timeanddate.com/time/zones/cat CAT Timezone must be parsed as +02:00. But it is getting parsed as -10:00

Actual:

> DateTime.parse("28 Sep 2020 12:00PM CAT").zone
=> "-10:00" 

Expected:

> DateTime.parse("28 Sep 2020 12:00PM CAT").zone
=> "+02:00" 
jeremyevans commented 3 years ago

The zonetab.list file is updated using the ext/date/update-abbr file. This skips existing entries by design, my guess would be for backwards compatibility. If you do remove the cat entry, you get 7200, so it does looks like the current offset for cat is not correct. @nobu, how do you think we should handle this? Should update-abbr compare the existing entries to the downloaded entries and report differences?

nobu commented 3 years ago

https://github.com/ruby/date/compare/master...nobu:fix-update-abbr

Seems more 6 differences. I don't know where these came from.

jeremyevans commented 3 years ago

@nobu I reviewed your fix-update-abbr branch and I think we should merge it.