Project

General

Profile

Actions

Bug #13101

closed

Date#rfc2822 and Time#rfc2822 don't return the same format

Added by iain_nl (Iain Hecker) over 7 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
[ruby-core:78969]

Description

Using the rfc2822 method on various date/time classes returns a slightly different result each time:

Time.now.rfc2822     # => "Wed, 04 Jan 2017 10:21:06 -0500"
Date.today.rfc2822   # => "Wed, 4 Jan 2017 00:00:00 +0000"
Time.now.utc.rfc2822 # => "Wed, 04 Jan 2017 15:21:28 -0000"
DateTime.now.rfc2822 # => "Wed, 4 Jan 2017 10:21:39 -0500"

I don't think rfc2822 specifies if the day needs to have a prefix. The difference between the time zone +0000 and -0000 is technically correct.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0