Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TZInfo::PeriodNotFound for Santiago timezone from 2014-09-07 00:00:00 to 2014-09-07 00:59:59 #25

Closed
smetana opened this issue Aug 12, 2014 · 1 comment

Comments

@smetana
Copy link

@smetana smetana commented Aug 12, 2014

Unable to use local time for Santiago timezone
between 2014-09-07 00:00:00 and 2014-09-07 00:59:59
TZInfo::PeriodNotFound is raised

Steps to reproduce

require 'rubygems'
require 'tzinfo'
tz = TZInfo::Timezone.get('America/Santiago')

local = tz.local_to_utc(Time.utc(2014,9,6,23,59,59)) # => OK
local = tz.local_to_utc(Time.utc(2014,9,7,1,0,0)) # =>  OK
local = tz.local_to_utc(Time.utc(2014,9,7,0,0,0)) # => TZInfo::PeriodNotFound

TZInfo::PeriodNotFound: TZInfo::PeriodNotFound
        from /usr/lib/ruby/gems/1.8/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:390:in `period_for_local'
        from /usr/lib/ruby/gems/1.8/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:474:in `local_to_utc'
        from /usr/lib/ruby/gems/1.8/gems/tzinfo-1.2.2/lib/tzinfo/time_or_datetime.rb:317:in `wrap'
        from /usr/lib/ruby/gems/1.8/gems/tzinfo-1.2.2/lib/tzinfo/timezone.rb:470:in `local_to_utc'
        from (irb):9
@smetana
Copy link
Author

@smetana smetana commented Aug 12, 2014

Just realized that September 7 between 00:00 and 1:00 does not exists because of DST. Sorry

@smetana smetana closed this Aug 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.