Skip to content

Commit e0f1f13

Browse files
TKharaishvilidougbu
authored andcommitted
FormattingUtilities support for parsing dates in RFC 850 long year format (#196)
- also add RFC 850 long year format related test case
1 parent 2109e7e commit e0f1f13

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/System.Net.Http.Formatting/FormattingUtilities.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ internal static class FormattingUtilities
3030
"d MMM yy H:m:s 'GMT'", // RFC 1123, no day-of-week, short year
3131
"d MMM yy H:m:s", // RFC 1123, no day-of-week, short year, no zone
3232

33-
"dddd, d'-'MMM'-'yy H:m:s 'GMT'", // RFC 850
33+
"dddd, d'-'MMM'-'yy H:m:s 'GMT'", // RFC 850, short year
3434
"dddd, d'-'MMM'-'yy H:m:s", // RFC 850 no zone
35+
"ddd, d'-'MMM'-'yyyy H:m:s 'GMT'", // RFC 850, long year
3536
"ddd MMM d H:m:s yyyy", // ANSI C's asctime() format
3637

3738
"ddd, d MMM yyyy H:m:s zzz", // RFC 5322

test/System.Net.Http.Formatting.Test/FormattingUtilitiesTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public static TheoryDataSet<string, DateTimeOffset> ValidDateValues
100100
// RFC850 date/time value
101101
{ "Sunday, 06-Nov-94 08:49:37 GMT", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) },
102102
{ "Sunday, 6-Nov-94 8:49:37", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) },
103+
{ "Sun, 6-Nov-1994 8:49:37 GMT", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) },
103104

104105
// ANSI C's asctime() format
105106
{ "Sun Nov 06 08:49:37 1994", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) },

0 commit comments

Comments
 (0)