Bug #13101
closedDate#rfc2822 and Time#rfc2822 don't return the same format
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.
Updated by mozamimy (Moza USANE) about 8 years ago
I created a patch to solve this issue in https://github.com/ruby/ruby/pull/1566
I want committers to merge this patch if it's acceptable :)
Updated by mozamimy (Moza USANE) about 8 years ago
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.
Updated by akr (Akira Tanaka) almost 8 years ago
- Status changed from Open to Feedback
I think there is no problem with time.rb.
I don't want to change the day format in time.rb
because the current behavior is valid according to RFC 2822 and
needless behavior change can cause incompatibility.
Also, time.rb's -0000 is intentional.
It distinguishes UTC from the standard time of UK.
Updated by jeremyevans0 (Jeremy Evans) almost 6 years ago
- Status changed from Feedback to Closed