tai-0: Support library to enable TAI usage on systems with time kept in UTC.

Data.Time.Clock.TAI.Support

Synopsis

Documentation

data TAISync Source #

Our data about TAI in relation to UTC and this system.

A function that enacts the periodic update of the LeapSecondList leap second data. Usually periodicBackgroundDownload will satisfy a user's needs, but some enviroments may want another policy.

Given an UpdatePolicy, generate a TAISync to be used to interact with TAI though the other library functions.

getTAI :: MonadIO m => TAISync -> m AbsoluteTime Source #

Get the current TAI time.

Given our information about leap seconds, generate a UTC time from a TAI time as a total function. As the relation between TAI is only known for a specific time range, we give a best-guess outside said time range. Specificly we only know the offset after some point in the past, and up to about 6 months into the future. Outside this range we assume the last known mapping between UTC and TAI doesn't drift.

Given our information about leap seconds, generate a TAI time rom a UTC time as a total function. As the relation between TAI is only known for a specific time range, we give a best-guess outside said time range. Specificly we only know the offset after some point in the past, and up to about 6 months into the future. Outside this range we assume the last known mapping between UTC and TAI doesn't drift.

Gets the current leap second data in a time compatable form.

Update the leap second table by redownloading the tables periodicly in the background. This policy uses the TimeoutManager to check for a new table every dbetween days, trying again dretry if there is a failure. Recomended values are 30 and 1 for these. Given the validity period for leap second data, this should generally suffice. There can be problems with local files being near their expiration though.

This policy requires a threaded runtime.