module Cf_stdtime:sig
..end
Cf_tai64
).
Note: no facility is yet provided here for manipulating time with associated timezone attributes. Converting arbitrary values of UTC time to and from local time is tricky, since daylight savings time rules vary greatly from locality to locality and also over time.
Warning! The International Earth Rotation and Reference System Service
determines whether and when to insert or delete leap seconds into the UTC
timescale. These announcements are made every six months in an IERS
bulletin. The current implementation contains a hard-coded table of leap
seconds that was accurate at least until Jan 1, 2007.
type
t = {
|
year : |
(* | -2937947 .. 2941664, 1 BC == 0 | *) |
|
month : |
(* | january=1 .. december=12 | *) |
|
day : |
(* | 1 .. 31 | *) |
|
hour : |
(* | 0 .. 23 | *) |
|
minute : |
(* | 0 .. 59 | *) |
|
second : |
(* | 0 .. 60, 60=leap second | *) |
val utc_of_tai64 : ?wday:int Pervasives.ref ->
?yday:int Pervasives.ref -> Cf_tai64.t -> t
utc_of_tai64 ~wday ~yday tai
to
obtain a UTC standard time record corresponding to the TAI time index
tai
. Optionally, if ~wday and/or ~yday are provided, this function
stores the day of the week (0=sunday,6=saturday) in wday
and the day of
year (1..366) in yday
.val utc_to_tai64 : year:int ->
month:int -> day:int -> hour:int -> minute:int -> second:int -> Cf_tai64.t
utc ~year ~month ~day ~hour ~minute
~sec
to obtain a TAI64 value corresponding to the UTC standard time
specified by the ~year ~month ~day ~hour ~minute ~sec
arguments. Raises
Invalid_argument
if the time specified is not a valid UTC time value.val utc_to_tai64_unsafe : year:int ->
month:int -> day:int -> hour:int -> minute:int -> second:int -> Cf_tai64.t
utc_to_tai64
, except it assumes the input is a valid
UTC time value. If it isn't, then the result is undefined.