Skip to content

Commit

Permalink
refactor(timestamp): remove redundant .UTC() call and mentions
Browse files Browse the repository at this point in the history
Unix timestamps are always from UTC epoch, and calculation from given
`time.Time` is independent of its location.
  • Loading branch information
scop committed Sep 8, 2023
1 parent a1d104f commit 8bff1ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ulid.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ var maxTime = ULID{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}.Time()
func MaxTime() uint64 { return maxTime }

// Now is a convenience function that returns the current
// UTC time in Unix milliseconds. Equivalent to:
// time in Unix milliseconds. Equivalent to:
//
// Timestamp(time.Now().UTC())
func Now() uint64 { return Timestamp(time.Now().UTC()) }
// Timestamp(time.Now())
func Now() uint64 { return Timestamp(time.Now()) }

// Timestamp converts a time.Time to Unix milliseconds.
//
Expand Down

0 comments on commit 8bff1ec

Please sign in to comment.