RFC822 Date format in Golang

269 Views Asked by At

Why Golang time format (RFC-822 in this case) is different from the one described in the RFC?

In time package RFC822 const value is defined as:

RFC822 = "02 Jan 06 15:04 MST"

11 Nov 09 00:00 CET

But regarding to RFC-822 or w3.org Validator date format should be rather as RFC1123:

RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"

Wed, 11 Nov 2009 00:00:00 CET

or even better:

RFC1123Z    = "Mon, 02 Jan 2006 15:04:05 -0700"

Wed, 11 Nov 2009 00:00:00 +0100

Because the Central European Time Zone (CET) is not correct in this RFC.

Why such a difference? I'm writing an RSS server and it took me a while to figure out why I'm getting badly formatted results.

0

There are 0 best solutions below