Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: Parse unable to handle timezone offsets with seconds (+00:34:08) #4934

Closed
gopherbot opened this issue Feb 28, 2013 · 5 comments

Comments

Projects
None yet
4 participants
@gopherbot
Copy link

commented Feb 28, 2013

by ulf@nhumi.com:

Trying to parse a time string like "0001-01-01 00:34:08+00:34:08" with the
pattern "2006-01-02 15:04:05-07:00:00" fails with a: cannot parse ""
as ":00". See http://play.golang.org/p/QFdTQ53Wol for small test case.
Removing the seconds from the pattern and time string works. 

The time string seem to be legitimate enough according to
http://en.wikipedia.org/wiki/Zoneinfo where America/New_York as an offset with seconds
before 1883-11-18

Zone America/New_York   -4:56:02 -      LMT     1883 Nov 18 12:03:58

I ran into this storing a Time struct in postgres as a timestamp with time zone. In my
timezone I get "0001-01-01 00:34:08+00:34:08" storing the result of
Format(time.RFC3339Nano) on an empty Time struct.

I'd be happy to help out fixing this but as my knowledge of time issues is rather
limited I'm not sure if it's only a matter of making time/format.go:nextStdChunk handle
the seconds in case '-'?
@adg

This comment has been minimized.

Copy link
Contributor

commented Mar 1, 2013

Comment 1:

If this is easy we should support it, I suppose.

Labels changed: added priority-later, removed priority-triage.

Status changed to Thinking.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2013

Comment 2:

[The time for maybe has passed.]

Labels changed: removed go1.1maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2013

Comment 3:

Labels changed: added go1.2maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2013

Comment 4:

Labels changed: added feature.

@robpike

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2013

Comment 5:

This issue was closed by revision aa38aea.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015

@rsc rsc removed the go1.2maybe label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.