Date#rfc2822 and Time#rfc2822 don't return the same format
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 akr (Akira Tanaka) over 4 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.