From: alice@... Date: 2017-03-29T09:30:49+00:00 Subject: [ruby-core:80468] [Ruby trunk Bug#13101] Date#rfc2822 and Time#rfc2822 don't return the same format Issue #13101 has been updated by mozamimy (Moza USANE). RFC 2822 says the date part should be 1 or 2 digits. So current behavior doesn't violate the specification but I think it is more natural to adjust format. ref. http://www.ietf.org/rfc/rfc2822.txt ---------------------------------------- Bug #13101: Date#rfc2822 and Time#rfc2822 don't return the same format https://bugs.ruby-lang.org/issues/13101#change-63963 * Author: iain_nl (Iain Hecker) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- 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. -- https://bugs.ruby-lang.org/ Unsubscribe: