[TZInfo-users] local_to_utc failure

Danny Burkes dburkes at infoteria.com
Mon Jan 28 19:24:23 EST 2008


Sorry- I put the previous code sample in terms of Rails'  
tzinfo_timezone plugin.  Here is some "raw" tzinfo code that  
illustrates the bug:

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))
TZInfo::PeriodNotFound: TZInfo::PeriodNotFound

If I use tzinfo 0.3.5, all is well-

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> gem 'tzinfo', "0.3.5"
=> 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))
=> #<DateTime: 117814303/48,0,2299161>
irb(main):006:0>

- Danny


More information about the TZInfo-users mailing list