From: pharrington Date: 2010-01-02T04:35:04+09:00 Subject: Re: problem opening the time class On Dec 31 2009, 4:52 pm, Cris Shupp wrote: > All, > > I am trying to open the Time class to add the following method. > I am always getting this error: > NameError: uninitialized constant Time::ZoneOffset > > when referencing ZoneOffset.  What am I doing wrong? > > class Time >   def self.offset_to_zone(offset) >     offset = offset.to_i >     ZoneOffset.each_pair do |time_zone, zone_offset| #ERROR OCCURS > HERE!!! >       return time_zone if (zone_offset == offset) >     end >     raise ArgumentError, "Illegal arguments!  The offset " << > offset.to_s << " is unknown." >   end > end > -- > Posted viahttp://www.ruby-forum.com/. As the error status, there is no Time::ZoneOffset constant.... Are you copying/pasting random code from somewhere? If not, what is ZoneOffset even supposed to be?