MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / Time

Method Time

streams.go:95–100  ·  view source on GitHub ↗

Time returns the time represented by this XID, accurate to one second.

()

Source from the content-addressed store, hash-verified

93
94// Time returns the time represented by this XID, accurate to one second.
95func (xid XID) Time() time.Time {
96 parts := strings.Split(xid.String(), "-")
97 tsec, _ := strconv.ParseInt(parts[0], 10, 64)
98
99 return time.Unix(tsec, 0)
100}
101
102// Seq returns the sequence number represented by this XID. To get the next and previous
103// valid XIDs for range pagination, see Next() and Prev().

Callers 4

NextMethod · 0.95
PrevMethod · 0.95
FirstMethod · 0.95
LastMethod · 0.95

Calls 1

StringMethod · 0.95

Tested by

no test coverage detected