We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
package main import( "fmt" "time" ) func main(){ timeLayout := "2006-01-02 15:04:05" t := "1990-08-17 13:14:15" t2 := "2000-08-17 13:14:15" loc, _ := time.LoadLocation("Asia/Shanghai") stamp, _ := time.ParseInLocation(timeLayout, t, loc) stamp2, _ := time.ParseInLocation(timeLayout, t2, loc) fmt.Println( "Datetime:", time.Unix(stamp.Unix(), 0) ) fmt.Println( "Datetime:", time.Unix(stamp2.Unix(), 0) ) }
The text was updated successfully, but these errors were encountered:
The reason is that Daylight Savings Time was observed in China between 1986 and 1991.
I'm going to close this issue since it doesn't appear to be a bug in Go. Please use https://github.com/golang/go/wiki/Questions if you have further questions. Thanks.
Sorry, something went wrong.
Oh, Thank you!
No branches or pull requests
Time error?
Result
Datetime: 2000-08-17 13:14:15 +0800 CST
Why is there an hour difference?
The text was updated successfully, but these errors were encountered: