]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1] time.RFC822: make the string standard-compliant
authorRob Pike <r@golang.org>
Tue, 3 Apr 2012 20:54:39 +0000 (06:54 +1000)
committerRob Pike <r@golang.org>
Tue, 3 Apr 2012 20:54:39 +0000 (06:54 +1000)
««« backport fda7b4c9978d
time.RFC822: make the string standard-compliant
For mysterious reasons, the existing string was just wrong: it was missing a colon.
There is no apparent reason for this discrepancy.

This should be safe to fix because existing uses would not be RFC822-compliant;
people cannot be depending on it to generate correct mail headers.

Fixes #3444.

R=golang-dev, dsymonds, iant, rsc
CC=golang-dev
https://golang.org/cl/5969072
»»»

src/pkg/time/format.go
src/pkg/time/time_test.go

index ad52bab216f8545835a7aae71727ab08a67aa3fc..98d4bb5c657ff63cfa6c46dc15b7e552683bf1e2 100644 (file)
@@ -41,8 +41,8 @@ const (
        ANSIC       = "Mon Jan _2 15:04:05 2006"
        UnixDate    = "Mon Jan _2 15:04:05 MST 2006"
        RubyDate    = "Mon Jan 02 15:04:05 -0700 2006"
-       RFC822      = "02 Jan 06 1504 MST"
-       RFC822Z     = "02 Jan 06 1504 -0700" // RFC822 with numeric zone
+       RFC822      = "02 Jan 06 15:04 MST"
+       RFC822Z     = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
        RFC850      = "Monday, 02-Jan-06 15:04:05 MST"
        RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"
        RFC1123Z    = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
index 3430526b8bff2d6e3b43c3ee424078dee655fd56..fdff0ec36c18f4a6ec30e20beb97a7f64524a222 100644 (file)
@@ -223,7 +223,7 @@ var formatTests = []FormatTest{
        {"ANSIC", ANSIC, "Wed Feb  4 21:00:57 2009"},
        {"UnixDate", UnixDate, "Wed Feb  4 21:00:57 PST 2009"},
        {"RubyDate", RubyDate, "Wed Feb 04 21:00:57 -0800 2009"},
-       {"RFC822", RFC822, "04 Feb 09 2100 PST"},
+       {"RFC822", RFC822, "04 Feb 09 21:00 PST"},
        {"RFC850", RFC850, "Wednesday, 04-Feb-09 21:00:57 PST"},
        {"RFC1123", RFC1123, "Wed, 04 Feb 2009 21:00:57 PST"},
        {"RFC1123Z", RFC1123Z, "Wed, 04 Feb 2009 21:00:57 -0800"},