3 ms·
> Time should be represented as unsigned integers, while time-differences should be represented as signed integers. > "10 minutes ago" is int64. June 9th 2023
by lelanthran 3y ago
> Time should be represented as unsigned integers, while time-differences should be represented as signed integers.
> "10 minutes ago" is int64. June 9th 2023 should be unsigned integer64.
Won't you run into problems with trying to turn "ten minutes before 1970" into a time?
IOW, if you subtract two `time` types, the result must be a valid `time` type, so you can add/subtract to it. The result cannot be a `timediff` type.
- feoren 3y ago> if you subtract two `time` types, the result must be a valid `time` type, so you can add/subtract to it. The result cannot be a `timediff` type. Huh? Of course `time` - `time` gives a `timediff` type. You can add/subtract to it: you add/subtract timediffs, or you can add/subtract a timediff to/from a time. Why would you ever be directly adding times? What is 100 AD + 100 AD? 200 AD? Not if you pick a different 0-point for your calendar ...