Skip to content

Commit 0c6811b

Browse files
shahriyoraphuslu
authored andcommitted
fix retrieving incorrect timestamp from XID
1 parent 30419ac commit 0c6811b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

xid.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewXIDWithTime(timestamp int64) (x XID) {
4242

4343
// Time returns the timestamp part of the id.
4444
func (x XID) Time() time.Time {
45-
return time.Unix(int64(x[0])<<32|int64(x[1])<<16|int64(x[2])<<8|int64(x[3]), 0)
45+
return time.Unix(int64(x[0])<<24|int64(x[1])<<16|int64(x[2])<<8|int64(x[3]), 0)
4646
}
4747

4848
// Machine returns the 3-byte machine id part of the id.

0 commit comments

Comments
 (0)