Files
moby/pkg/system
Sebastiaan van Stijn 2c9684e35c pkg/system: add note about maxTime
This code caused me some head-scratches, and initially I wondered
if this was a bug, but it looks to be intentional to set nsec, not
sec, as time.Unix() internally divides nsec, and sets sec accordingly;
https://github.com/golang/go/blob/go1.19.2/src/time/time.go#L1364-L1380

    // Unix returns the local Time corresponding to the given Unix time,
    // sec seconds and nsec nanoseconds since January 1, 1970 UTC.
    // It is valid to pass nsec outside the range [0, 999999999].
    // Not all sec values have a corresponding time value. One such
    // value is 1<<63-1 (the largest int64 value).
    func Unix(sec int64, nsec int64) Time {
        if nsec < 0 || nsec >= 1e9 {
            n := nsec / 1e9
            sec += n
            nsec -= n * 1e9
            if nsec < 0 {
                nsec += 1e9
                sec--
            }
        }
        return unixTime(sec, int32(nsec))
    }

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-07 18:34:34 +02:00
..
2022-10-07 18:34:34 +02:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2021-12-15 22:15:07 -08:00
2018-02-05 16:51:57 -05:00
2021-09-22 09:47:35 +03:00
2022-09-28 01:58:49 +02:00
2018-02-05 16:51:57 -05:00
2021-06-10 13:03:42 +02:00
2018-02-05 16:51:57 -05:00
2020-08-12 11:40:58 +02:00
2022-10-05 16:21:04 +02:00