On Sun, Jul 10, 2016 at 3:27 AM, Saku Ytti <saku@ytti.fi> wrote: [snip]
a) use UTC or unix time, and accept that code is broken [snip]
The Unix time format might be an unsuitable time representation for applications which require clock precision or time precision within a few seconds for the purposes of Timestamping or synchronizing events down to a Per-Second or Subsecond resolution. Suggest revising Unix/POSIX Time implementation to use a 3-Tuple representation of calendar time, instead of a single Integer. typedef int64_t time_t [3]; [ Delta from Epoch in Seconds, Delta in Microseconds, Cumulative Leap Adjustment from the Epoch in Microseconds] Thus to compare two timestamps A and B long long difference_in_seconds(time_t A, time_t B) { return (B[0] - A[0]) + ( B[1] - A[1] + B[2] - A[2] ) /1000000; } -- -JH