这是出于好奇,而不是因为此时我需要了解它,但在 PHP 手册中,它们是相同的;我看不出为什么同一件事有两种不同的数据格式。
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" ;
有什么线索吗?
最佳答案
RFC1123 是“Internet 主机的要求 - 应用和支持”,1989 年 10 月
RFC2822 是“Internet 消息格式”,2001 年 4 月
将 RFC1123 视为 RFC2822 的父级。它引用 RFC2822 作为日期/时间的适当规范,如下所示:
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
关于php - PHP 中的 RFC1123 和 RFC2822 日期时间格式有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12569141/