def year=(value)
      value = 0 if value.nil?

      if value.is_a?(String) 
        if value.length == 0
          value = 0
        elsif value =~ /\A\-?\d{1,7}\z/
          value = value.to_i
        else
          raise YearError, "Year must be a valid string or integer from -1048576 to 1048576"
        end
      end

      if (value >= -1048576 && value <= 1048576) 
        @bits = self.class.set_year(@bits, value)
      else
        raise YearError, "Year must be an integer from -1048576 to 1048576"
      end
    end
def year=(value)
      value = 0 if value.nil?

      if value.is_a?(String) 
        if value.length == 0
          value = 0
        elsif value =~ /\A\-?\d{1,7}\z/
          value = value.to_i
        else
          raise YearError, "Year must be a valid string or integer from -1048576 to 1048576"
        end
      end

      if (value >= -1048576 && value <= 1048576) 
        @bits = self.class.set_year(@bits, value)
      else
        raise YearError, "Year must be an integer from -1048576 to 1048576"
      end
    end
Public: Sets the year portion of a partial date.

 value - The string or integer value for a year.

 Examples
   date.year = "2000"
   date.value
   # => 20000000

 Returns nothing