Time::TAI64 - a library for storing and manipulating dates and times.
use Time::TAI64 qw( :caldate :caltime :tai :leapsecs :taia ); use Time::TAI64 qw( :all );
NOTE: THIS IS AN EXPERIMENTAL VERSION. THE USER INTERFACE WILL CHANGE AND IT WILL CHANGE DRASTICALLY. PLEASE WAIT UNTIL VERSION 1.9 BEFORE USING THIS MODULE.
ALSO, A LOT OF THE CODE WILL CHANGE. SO, DON'T RELY ON ANYTHING IN THIS MODULE BEING THE SAME IN TWO WEEKS. OH, AND THE DOCUMENTATION WILL BE DRASTICALLY IMPROVED.
THAT SAID, TEST FAILURES WOULD BE APPRECIATED =)
Time::TAI64 is a library for storing and manipulating dates and times.
Time::TAI64 supports two time scales:
TAI64, covering a few hundred billion years with 1-second precision
TAI64NA, covering the same period with 1-attosecond precision. Both scales are defined in terms of TAI, the current international real time standard.
Time::TAI64 provides an internal format for TAI64, TAIPtr, designed for fast time manipulations. The tai_pack() and tai_unpack() routines convert between struct tai and a portable 8-byte TAI64 storage format. Time::TAI64 provides similar internal and external formats for TAI64NA (TAIAPtr).
TAIPtr
TAIAPtr
Time::TAI64 provides CaldatePtr to store dates in year-month-day form. It can convert CaldatePtr, under the Gregorian calendar, to a modified Julian day number for easy date arithmetic.
CaldatePtr
Time::TAI64 provides CaltimePtr to store calendar dates and times along with UTC offsets. It can convert from TAIPtr to CaltimePtr in UTC, accounting for leap seconds, for accurate date and time display. It can also convert back from CaltimePtr to TAIPtr for user input. Its overall UTC-to-TAI conversion speed is 100x better than the usual UNIX mktime() implementation.
CaltimePtr
This version of Time::TAI64 requires a UNIX system with gettimeofday(). It will be easy to port to other operating systems with compilers supporting 64-bit arithmetic.
The preferred way of using this library is through objects. You don't have to though since the complete complement of functions is available via various export groups. See the FUNCTIONS section for more detail.
XXX
There's quite a few functions. 41 all up (unless I miscounted). This section is divided into the export groups.
I will warn you, up front, that your code will end up over long if you stick to using functions. Each data object produced by this module that is not a simple integer or string is an opaque object and you will need to use accessors to use its attributes. Thus, the OO interface is generally recommended.
Iain Truskett <spoon@cpan.org> http://eh.org/~koschei/
Please report any bugs to http://rt.cpan.org/ or email them (and/or suggestions to me directly at <spoon@cpan.org>
XS and Perl code copyright (c) 2002 Iain Truskett. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
C source files derived from qlogtools, copyright 2000 Bruce Guenter. Those derived from libtai are public domain. Those from daemontools are copyright 2001 D J Bernstein.
DJB for writing libtai and daemontools. Bruce Guenter for qlogtools.
See http://cr.yp.to/time.html, http://untroubled.org/qlogtools/
To install Time::TAI64, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Time::TAI64
CPAN shell
perl -MCPAN -e shell install Time::TAI64
For more information on module installation, please visit the detailed CPAN module installation guide.