MCPcopy Create free account
hub / github.com/facebook/time / GetTimePastUTC

Method GetTimePastUTC

fbclock/fbclock.go:126–136  ·  view source on GitHub ↗

GetTimePastUTC is GetTimePast but returns UTC-adjusted values.

(ts time.Time)

Source from the content-addressed store, hash-verified

124
125// GetTimePastUTC is GetTimePast but returns UTC-adjusted values.
126func (f *FBClock) GetTimePastUTC(ts time.Time) (*TrueTime, error) {
127 tt := &C.fbclock_truetime{}
128 errCode := C.fbclock_gettime_past_utc(f.cFBClock, C.int64_t(ts.UnixNano()), tt)
129 if errCode != 0 {
130 return nil, fmt.Errorf("reading FBClock TrueTime past UTC: %s", strerror(errCode))
131 }
132 return &TrueTime{
133 Earliest: time.Unix(0, int64(tt.earliest_ns)),
134 Latest: time.Unix(0, int64(tt.latest_ns)),
135 }, nil
136}

Callers

nothing calls this directly

Calls 2

strerrorFunction · 0.85
UnixMethod · 0.80

Tested by

no test coverage detected