Wireshark-dev: [Wireshark-dev] Re: Time and time scales in Wireshark

Date Prev · Date Next · Thread Prev · Thread Next
From: Martin Mayer <martin.mayer@xxxxxxxxxxxxxxxxxx>
Date: Mon, 3 Aug 2026 07:57:05 +0000
A short overview for the different approaches:

+-----------------------------+------------------------------+-------------+---------------+-------------------+-----------------------------------------------+
| Approach                    | Epoch Start                  | Leap-second |  Show scales  |   Show scales     | Comments                                      |
|                             |                              |    aware    | in SI-seconds | in NON SI-seconds |                                               |
+-----------------------------+------------------------------+-------------+---------------+-------------------+-----------------------------------------------+
| Use UNIX time for nstime_t  | 1970-01-01 00:00:00 UTC      | no          | yes           | mostly            | Easiest when inaccuracy is acceptable.        |
| (current)                   |                              |             |               | w/ data only [1]  |                                               |
+-----------------------------+------------------------------+-------------+---------------+-------------------+-----------------------------------------------+
| Use SI-second for nstime_t  | 1970-01-01 00:00:00 UTC      | yes         | yes           | yes               | Can be used easily and accurate for any scale |
| (UNIX epoch)                |                              |             |               | w/ data only [1]  | that uses SI-seconds. (C routines available)  |
+-----------------------------+------------------------------+-------------+---------------+-------------------+-----------------------------------------------+
| Use SI-second for nstime_t  | 1958-01-01 00:00:00 TAI      | yes         | yes           | yes               | Can be used easily and accurate for any scale |
| (TAI epoch)                 | (=UTC, proleptic assumption) |             |               | w/ data only [1]  | that uses SI-seconds.                         |
+-----------------------------+------------------------------+-------------+---------------+-------------------+-----------------------------------------------+
| Two-part (Modified) Julian  | −4712-01-01 12:00:00 UT (JD) | yes         | yes           | yes               | Common scientific format                      |
| Date                        | 1858-11-17 00:00:00 UT (MJD) |             |               | w/ data only [1]  |                                               |
+-----------------------------+------------------------------+-------------+---------------+-------------------+-----------------------------------------------+
| Use time scale's native     | depending on scale           | d.o.s.      | d.o.s. and    | d.o.s             | Compatibility or calculations with other time |
| second and store scale type | (d.o.s.)                     |             | w/ data [1]   |                   | scales may be hard.                           |
+-----------------------------+------------------------------+-------------+---------------+-------------------+-----------------------------------------------+

[1]: Requires IERS data

------------------

It may make sense to check if existing software can be used. Have a look at IAU SOFA libraries which seem to be common in scientific applications (https://www.iausofa.org/current-software).
Don't know if it is compatible in terms of license etc.

Martin