Skip to content

Commit

Permalink
Use legacy go versions compatible unix millisecond calculation (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
convto committed Oct 31, 2022
1 parent e420387 commit e1079f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generator.go
Expand Up @@ -285,7 +285,7 @@ func (g *Gen) NewV7() (UUID, error) {
}

tn := g.epochFunc()
ms := uint64(tn.UnixMilli())
ms := uint64(tn.Unix())*1e3 + uint64(tn.Nanosecond())/1e6
u[0] = byte(ms >> 40)
u[1] = byte(ms >> 32)
u[2] = byte(ms >> 24)
Expand Down

0 comments on commit e1079f3

Please sign in to comment.