classification
Title: Please support CLOCK_TAI in the time module.
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, r3owen, vstinner
Priority: normal Keywords: patch

Created on 2020-03-19 19:14 by r3owen, last changed 2020-03-24 03:41 by benjamin.peterson. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19096 merged r3owen, 2020-03-21 00:36
Messages (3)
msg364633 - (view) Author: Russell Owen (r3owen) * Date: 2020-03-19 19:14
It is becoming common (at least in astronomy) to want to use TAI as a time standard because it is a uniform time with no leap seconds, and differs from UTC (standard computer clock time) by an integer number of seconds that occasionally changes.

Linux offers a clock for TAI time: CLOCK_TAI. It would be very helpful to have this constant in the time module, e.g. for calling time.clock_gettime

Caveat: linux CLOCK_TAI will return UTC time if the leap second table has not been set up. Both ntp and ptp can be configured to maintain this table. So this is a caveat worth mentioning in the docs. But I hope it is not sufficient reason to deny the request.
msg364637 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2020-03-19 20:37
I think we could certainly take a patch to expose that constant if libc/kernel headers expose it.
msg364915 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2020-03-24 03:41
New changeset 6000087fe979705dc588a46a35da884cc0198c67 by Russell Owen in branch 'master':
closes bpo-40017: Add CLOCK_TAI constant to the time module. (GH-19096)
https://github.com/python/cpython/commit/6000087fe979705dc588a46a35da884cc0198c67
History
Date User Action Args
2020-03-24 03:41:46benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg364915

stage: patch review -> resolved
2020-03-21 00:36:25r3owensetkeywords: + patch
stage: patch review
pull_requests: + pull_request18455
2020-03-19 20:43:09vstinnersetnosy: + vstinner
2020-03-19 20:37:23benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg364637
2020-03-19 19:14:59r3owencreate