@@ -103,7 +103,9 @@ class RFC3339DateFormatter: PermissiveDateFormatter, @unchecked Sendable {
103
103
/// List of date formats supported for RFC3339.
104
104
override var dateFormats : [ String ] {
105
105
[
106
+ // RFC 3339 without fractional seconds.
106
107
" yyyy-MM-dd'T'HH:mm:ssZZZZZ " ,
108
+ // RFC 3339 with 2-digit fractional seconds (limited precision).
107
109
" yyyy-MM-dd'T'HH:mm:ss.SSZZZZZ " ,
108
110
]
109
111
}
@@ -125,19 +127,26 @@ class RFC822DateFormatter: PermissiveDateFormatter, @unchecked Sendable {
125
127
/// List of date formats supported for RFC822.
126
128
override var dateFormats : [ String ] {
127
129
[
130
+ // RFC 822/1123 format with seconds.
128
131
" EEE, d MMM yyyy HH:mm:ss zzz " ,
132
+ // RFC 822/1123 format without seconds.
129
133
" EEE, d MMM yyyy HH:mm zzz " ,
130
- " d MMM yyyy HH:mm:ss Z " ,
131
- " yyyy-MM-dd HH:mm:ss Z " ,
134
+ // RFC 822 compatible, includes day, month, year, time, and timezone.
135
+ " d MMM yyyy HH:mm:ss zzz " ,
136
+ // RFC 822 compatible, similar to above but without seconds.
137
+ " d MMM yyyy HH:mm zzz " ,
138
+ // RFC 822 compatible, includes weekday, day, month, year, time, and timezone.
139
+ " EEE, dd MMM yyyy, HH:mm:ss zzz " ,
132
140
]
133
141
}
134
142
135
143
/// Backup date formats to handle potential parsing issues.
136
144
override var permissiveDateFormats : [ String ] {
137
145
[
138
- " d MMM yyyy HH:mm:ss zzz " ,
139
- " d MMM yyyy HH:mm zzz " ,
140
- " EEE, dd MMM yyyy, HH:mm:ss zzz " ,
146
+ // Non-standard, similar to RFC 822 with numeric timezone.
147
+ " d MMM yyyy HH:mm:ss Z " ,
148
+ // Non-standard, ISO-like format with numeric timezone.
149
+ " yyyy-MM-dd HH:mm:ss Z " ,
141
150
]
142
151
}
143
152
0 commit comments