GetTimePastUTC is GetTimePast but returns UTC-adjusted values.
(ts time.Time)
| 124 | |
| 125 | // GetTimePastUTC is GetTimePast but returns UTC-adjusted values. |
| 126 | func (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 | } |