Skip to content

time: RFC3339 timestamps are wrongly formatted  #34725

@daltek

Description

@daltek

What version of Go are you using (go version)?

$ go version go1.11.6 linux/amd64


Please refer to the first post in Issue #31113 which was closed after getting distracted about whether colons in numerical offsets are optional.

The actual issue is with the Z followed by an offset.

Timezone offsets should be represented by either a "+" (positive offset) for hours added to UTC in zones East of the prime meridian, or a "-" (negative offset) for zones to the West.

The Z suffix (meaning Zero hours offset from UTC, based on military use of the phonetic alphabet, hence "Zulu" time), if it is used, should be the last character in a zero-offset (UTC) timestamp. However a UTC timestamp may instead be represented by a numeric offset of +00:00 hours.

I believe Go has misinterpreted the RFC and so presents the example timestamp:

 2006-01-02T15:04:05Z07:00 

which has a Z (meaning UTC), and then an ambiguous offset from it.

In that example the "Z" should be a "-" as all the examples are set in the Mountain Standard Timezone. RFC-3339 is quite clear that numeric offsets should be prefixed by either a "+" or a "-", or that a "Z" may be used instead when there is no offset.

Putting an offset after the Z only makes things more confusing, as not only is it wrong, but it has what appears to be a positive number for what is actually a negative offset.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions