HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/ruby/vendor_ruby/mail/fields/common/common_date.rb
# encoding: utf-8
# frozen_string_literal: true
module Mail
  module CommonDate # :nodoc:
    # Returns a date time object of the parsed date
    def date_time
      ::DateTime.parse("#{element.date_string} #{element.time_string}")
    end

    def default
      date_time
    end
    
    def parse(val = value)
      unless Utilities.blank?(val)
        @element = Mail::DateTimeElement.new(val)
      else
        nil
      end
    end

    private
    
    def do_encode(field_name)
      "#{field_name}: #{value}\r\n"
    end
    
    def do_decode
      "#{value}"
    end

    def element
      @element ||= Mail::DateTimeElement.new(value)
    end
  end
end