Time converts Unix milliseconds in the format returned by the Timestamp function to a time.Time.
(ms uint64)
| 450 | // Time converts Unix milliseconds in the format |
| 451 | // returned by the Timestamp function to a time.Time. |
| 452 | func Time(ms uint64) time.Time { |
| 453 | s := int64(ms / 1e3) |
| 454 | ns := int64((ms % 1e3) * 1e6) |
| 455 | return time.Unix(s, ns) |
| 456 | } |
| 457 | |
| 458 | // SetTime sets the time component of the ULID to the given Unix time |
| 459 | // in milliseconds. |
no outgoing calls
no test coverage detected
searching dependent graphs…