MCPcopy
hub / github.com/oklog/ulid / Timestamp

Function Timestamp

ulid.go:445–448  ·  view source on GitHub ↗

Timestamp converts a time.Time to Unix milliseconds. Because of the way ULID stores time, times from the year 10889 produces undefined results.

(t time.Time)

Source from the content-addressed store, hash-verified

443// Because of the way ULID stores time, times from the year
444// 10889 produces undefined results.
445func Timestamp(t time.Time) uint64 {
446 return uint64(t.Unix())*1000 +
447 uint64(t.Nanosecond()/int(time.Millisecond))
448}
449
450// Time converts Unix milliseconds in the format
451// returned by the Timestamp function to a time.Time.

Callers 2

MustNewDefaultFunction · 0.85
NowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…