/Cinny
how is unix time defined
/Cinny
Follow-up: is unix time strictly monotonic, assuming it is driven by a monotonic clock source?
/Cinny
Follow up 2: is it possible to determine the exact duration between two unix time stamps assuming a perfectly accurate clock that is stationary in an inertial reference frame
@charlotte not sure I read that right; it’s the number of seconds since Epoch. There is no removing of leap seconds, as they are not added anywhere, not accounted for; a day is always 86.400 seconds.
So, if you do have leap seconds on your clock (this is normal), it will be out of sync with the second sized ticks since Epoch, hence why time libraries almost never return plain unix as only option.
I'm sure leap seconds are removed when calculating a local date+time from it.
Usually to then calculate a Representation of that local date+time as a string.
/Cinny
@evi unix timestamps are based on the tm struct monstrosity that is the fourth option, which includes leap seconds, but only on the day that they occur on. this also means that unix timestamps are neither strictly monotonic (the tm structs permits 61 seconds in a minute) nor monotonic (the tm struct permits 62 seconds in a minute also). the third one is a bit of a trick question but basically it’s possible to determine if the unix timestamp refers to a time some time before 6 months from now
@charlotte devil is always in the details; I usually only needed this for calculations (way) in the past and even then basically always had to look it up.