[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Leap Second planned for 2016
- Subject: Leap Second planned for 2016
- From: mysidia at gmail.com (Jimmy Hess)
- Date: Sun, 10 Jul 2016 13:28:29 -0500
- In-reply-to: <CAAeewD-p8w5M5neGMtT8qkE=2sBNyn2wUWUOqT22+31R_cmUig@mail.gmail.com>
- References: <[email protected]> <CA+M5dWbZM1kQx1dG6Ba_cEYOyH=f9X5vhuc6bmM6s8pCdbGx=g@mail.gmail.com> <[email protected]> <CAAeewD_kxj2g4=XaNk8jj5DCp8hEhtNY5JhAQesCyYGVy8Opew@mail.gmail.com> <[email protected]> <CAAeewD9LXBngWYT-RZJhC-oP7O2=BEDDjiQMmqWYJeKyyTgiUw@mail.gmail.com> <[email protected]> <CAAeewD-p8w5M5neGMtT8qkE=2sBNyn2wUWUOqT22+31R_cmUig@mail.gmail.com>
On Sun, Jul 10, 2016 at 3:27 AM, Saku Ytti <saku at 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