Skip to content

Commit

Permalink
Changed to use tn.UnixMilli() to get millisec precision timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
convto committed Sep 9, 2022
1 parent 9719ee8 commit 5279295
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (g *Gen) NewV7() (UUID, error) {
}

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

0 comments on commit 5279295

Please sign in to comment.