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)
| 443 | // Because of the way ULID stores time, times from the year |
| 444 | // 10889 produces undefined results. |
| 445 | func 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…