This is out of curiosity rather than because I need to know it at this point, but in the PHP manual, they're identical; I can't see the reason that there are two different data formats for the same thing.
http://php.net/manual/en/class.datetime.php
const string RFC1123 = "D, d M Y H:i:s O" ;
const string RFC2822 = "D, d M Y H:i:s O" ;
Any clue?
RFC1123 is "Requirements for Internet Hosts - Application and Support", October 1989
RFC2822 is "Internet Message Format", April 2001
Think of RFC1123 as a parent to RFC2822. It references RFC2822 as the appropriate spec for date/time, which are as follows:
3.3. Date and Time Specification
Date and time occur in several header fields. This section specifies the syntax for a full date and time specification. Though folding white space is permitted throughout the date-time specification, it is RECOMMENDED that a single space be used in each place that FWS appears (whether it is required or optional); some older implementations may not interpret other occurrences of folding white space correctly.
date-time = [ day-of-week "," ] date FWS time [CFWS]
day-of-week = ([FWS] day-name) / obs-day-of-week
day-name = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"
date = day month year
year = 4*DIGIT / obs-year
month = (FWS month-name FWS) / obs-month
month-name = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
day = ([FWS] 1*2DIGIT) / obs-day
time = time-of-day FWS zone
time-of-day = hour ":" minute [ ":" second ]
hour = 2DIGIT / obs-hour
minute = 2DIGIT / obs-minute
second = 2DIGIT / obs-second
zone = (( "+" / "-" ) 4DIGIT) / obs-zone
I think the reason is documentation. The date formats may be the same, but they are defined in different documents independently. And let's be honest
const string COMMON_DATE_FORMAT_FOR_RFC1123_AND_2822 = "D, d M Y H:i:s O" ;
would not be quite as usable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With