The Timestamp structure

The Timestamp structure provides a mechanism for generating timestamps that respect the SOURCE_DATE_EPOCH environment variable.

Synopsis

structure Timestamp

Interface

exception InvalidSourceDateEpoch of string

val makeTimestamp : Time.time -> Time.time

val now : unit -> Time.time

Description

exception InvalidSourceDateEpoch of string

The exception that is raised when the SOURCE_DATE_EPOCH environment variable is defined, but malformed.

val makeTimestamp : Time.time -> Time.time

makeTimestamp t returns a timestamp that is either t, when the environment variable SOURCE_DATA_EPOCH is not defined, and is the value of SOURCE_DATA_EPOCH interpreted as the number of seconds (excluding leap seconds) since January 1, 1970 00:00:00 UTC otherwise. If SOURCE_DATE_EPOCH is defined, but malformed, then the exception InvalidSourceDateEpoch s is raised, where s is the value of the SOURCE_DATE_EPOCH environment variable.

val now : unit -> Time.time

now () is equivalent to the expression makeTimestamp (Time.now ()).