Skip to content

time: ParseInLocation returns wrong timestamp for DST transition in America/Havana #35508

@jeffreydking

Description

@jeffreydking

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

go1.12.6

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

darwin/amd64

What did you do?

loc, _ := time.LoadLocation("America/Havana")
ts, _ := time.ParseInLocation("2006-01-02", "2019-03-10", loc)
fmt.Println(ts)

What did you expect to see?

This is an edge case where Cuba has declared DST be applied at 12 midnight (not 1am like in the USA). So, there is no midnight for 2019-03-10 in the America/Havana timezone. As such, the timestamp for the day should be the first available second of that day:

2019-03-10 01:00:00 -0400 CST

What did you see instead?

2019-03-09 23:00:00 -0500 CST

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions