[TZInfo-users] local_to_utc failure

Danny Burkes dburkes at infoteria.com
Tue Jan 29 11:43:26 EST 2008


Sorry, I left out a crucial piece of code :-)

It throws PeriodNotFound, even if I pass the dst flag to  
local_to_utc.  Viz-

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> gem 'tzinfo', "0.3.6"
=> true
irb(main):003:0> require 'tzinfo'
=> true
irb(main):004:0> tz = TZInfo::Timezone.get('America/Argentina/ 
Buenos_Aires')
=> #<TZInfo::DataTimezone: America/Argentina/Buenos_Aires>
irb(main):005:0> tz.local_to_utc(DateTime.new(2007,12,30,0,30,0), true)
TZInfo::PeriodNotFound: TZInfo::PeriodNotFound
        from /opt/local/lib/ruby/gems/1.8/gems/tzinfo-0.3.6/lib/tzinfo/ 
timezone.rb:338:in `period_for_local'
        from /opt/local/lib/ruby/gems/1.8/gems/tzinfo-0.3.6/lib/tzinfo/ 
timezone.rb:417:in `local_to_utc'
        from /opt/local/lib/ruby/gems/1.8/gems/tzinfo-0.3.6/lib/tzinfo/ 
time_or_datetime.rb:276:in `wrap'
        from /opt/local/lib/ruby/gems/1.8/gems/tzinfo-0.3.6/lib/tzinfo/ 
timezone.rb:413:in `local_to_utc'
        from (irb):5
irb(main):006:0> tz.local_to_utc(DateTime.new(2007,12,30,0,30,0), false)
TZInfo::PeriodNotFound: TZInfo::PeriodNotFound
        from /opt/local/lib/ruby/gems/1.8/gems/tzinfo-0.3.6/lib/tzinfo/ 
timezone.rb:338:in `period_for_local'
        from /opt/local/lib/ruby/gems/1.8/gems/tzinfo-0.3.6/lib/tzinfo/ 
timezone.rb:417:in `local_to_utc'
        from /opt/local/lib/ruby/gems/1.8/gems/tzinfo-0.3.6/lib/tzinfo/ 
time_or_datetime.rb:276:in `wrap'
        from /opt/local/lib/ruby/gems/1.8/gems/tzinfo-0.3.6/lib/tzinfo/ 
timezone.rb:413:in `local_to_utc'
        from (irb):6
irb(main):007:0>

My understanding from the docs is that, if I pass the dst flag to  
local_to_utc, it should never throw the exception.  Am I  
misunderstanding?

Best Regards,

Danny


More information about the TZInfo-users mailing list