def to_s(format = :default)
      format = FORMATS[format] if format.is_a?(Symbol)
      s = format.dup
      n = b = 0
      a = 1
      while n < s.length
        if s[n] == "%" && FORMAT_METHODS.include?(s[n..n+1])
          t = FORMAT_METHODS[s[n..n+1]].call( self ) 
          if t.length == 0  
            if n >= 0 && n < s.length - 2
              a = a + 1 if s[n+2] =~ REMOVALS
            else
              b = n - 1 if s[n-1] =~ REMOVALS
            end
          end
          s.slice!(b..n+a)
          s.insert(b, t)
          n = b = b + t.length 
          a = 1 
        else
          n = b += 1
        end
      end
      s
    end
def to_s(format = :default)
      format = FORMATS[format] if format.is_a?(Symbol)
      s = format.dup
      n = b = 0
      a = 1
      while n < s.length
        if s[n] == "%" && FORMAT_METHODS.include?(s[n..n+1])
          t = FORMAT_METHODS[s[n..n+1]].call( self ) 
          if t.length == 0  
            if n >= 0 && n < s.length - 2
              a = a + 1 if s[n+2] =~ REMOVALS
            else
              b = n - 1 if s[n-1] =~ REMOVALS
            end
          end
          s.slice!(b..n+a)
          s.insert(b, t)
          n = b = b + t.length 
          a = 1 
        else
          n = b += 1
        end
      end
      s
    end
Public: Returns a formatted string representation of date. A subset of
 date formatters have been implemented including:
 %Y - Year with century
 (can be negative, and will be padded to 4 digits at least)
             -0001, 0000, 1995, 2009, 14292, etc.
 %m - Month of the year, zero-padded (01..12)
 %B - The full month name ('January')
 %b - The abbreviated month name ('Jan')
 %d - Day of the month, zero-padded (01..31)
 %e - Day of the month, blank-padded ( 1..31)

 Examples

   date = PartialDate::Date.new {|d| d.year = 2012, d.month = 12, d.day = 31}
   date.to_s
   # => "2012-12-31"

 Returns string representation of date.