package orsetto
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=bb2af4d8b376b2d60fa996bd4d3b90d9f3559455672540f6d7c3598af81d483b
    
    
  md5=f7bfa83013801b42fcdba607af2f012b
    
    
  doc/orsetto.cf/Cf_stdtime/index.html
Module Cf_stdtime
Conversions between Standard Time, UTC and TAI.
Overview
This module contains a type for representing values of standard time, defined as a reference from Coordinated Universal Time (UTC). It also provides functions for converting values of standard time to and from TAI64 values (see 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 some are even subject to change without advance notice.
Types
class type  unqualified = object ... endThe class type inhabited by object types representing unqualified local time stamps, which comprise a Gregorian calendar date and a civil time synchronized with Coordinated Universal Time (UTC) without localizing time zone offset.
class type  epoch = object ... endThe class type inhabited by object types representing time stamps qualified with an integral offset from local time to UTC in minutes.
The private type inhabited by time stamps in UTC, i.e. with an explicit offset of +00:00.
The private type inhabited by time stamps qualified with a local timezone offset.
Functions
val create : 
  date:Cf_gregorian.date ->
  time:Cf_clockface.time ->
  offset:int ->
  localUse create ~date ~time ~offset to create a time stamp comprising ~date, ~time and ~offset.
Use localize t to convert the UTC time stamp t to a local time stamp. If ~offset is used, then the civil time and calendar date are adjusted accordingly. Raises Invalid_argument if the adjustment to the calendar date would overflow the 64-bit integer representation of the astronomical year.
Use local_to_utc to convert t to the UTC. Raises Invalid_argument in the untypical case that time zone adjustment results in an overflow in the 64-bit integer arithetic for the Gregorian calendar year.
Conversions to RFC 3394 Internet Timestamp
val local_to_inet : local -> stringUse local_to_inetlocal_to_inet t to make a string representation of t in the Internet Timestamp format, c.f RFC 3339.
val inet_to_local : string -> localUse inet_to_local s to make a timestamp with the value extracted from s according to the Internet Timestamp format.
Conversions to and from TAI64
val of_tai64 : Cf_tai64.t -> utcUse of_tai64 t to create the UTC time stamp corresponding to t.
val in_tai64_range : utc -> boolUsing in_tai64_range t returns true if t is within the range of valid TAI64 epochs (see Cf_tai64).
val to_tai64 : utc -> Cf_tai64.tUse to_tai64 t to create the TAI64 value corresponding to t. Raises Invalid_argument if t is outside the range of valid TAI64 values.