# File lib/rubygems/specification.rb, line 981
  def date= date
    # We want to end up with a Time object with one-day resolution.
    # This is the cleanest, most-readable, faster-than-using-Date
    # way to do it.
    @date = case date
            when String then
              if /\A(\d{4})-(\d{2})-(\d{2})\Z/ =~ date then
                Time.utc($1.to_i, $2.to_i, $3.to_i)
              else
                raise(Gem::InvalidSpecificationException,
                      "invalid date format in specification: #{date.inspect}")
              end
            when Time, Date then
              Time.utc(date.year, date.month, date.day)
            else
              TODAY
            end
  end