You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected output is as below
2016-09-11 18:35:00 +0500
but see time offset is repeating twice.
What did you see instead?
2016-09-11 18:35:00 +0500 +0500
The text was updated successfully, but these errors were encountered:
gbbr
changed the title
Time offset is getting repeated twice when date is parsed.
time: offset is getting repeated twice when date is parsed.
Nov 10, 2017
This is working as expected. When you print a time.Time value without formatting, it displays both the timezone offset and the timezone name. In your case the timezone has no name, so the time package is using the offset as the name.
If you want a different format, use the Format method.
@ianlancetaylor problem is when I am trying to compare 2 times:
1st from database: "2008-01-03 00:00:00 +0100 CET"
2nd from unmarshall: "2008-01-03 00:00:00 +0100 +0100"
those 2 times are the same, but when I compare it, go says they are different
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.9.2 windows/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?Windows/amd64
What did you do?
Parsed date with time offset. Please see link below.
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
https://play.golang.org/p/dhwzR4Y_LL
What did you expect to see?
Expected output is as below
2016-09-11 18:35:00 +0500
but see time offset is repeating twice.
What did you see instead?
2016-09-11 18:35:00 +0500 +0500
The text was updated successfully, but these errors were encountered: