BloombergLP::bdlt::CurrentTime

Provide a namespace for current-time retrieval procedures.

Synopsis

Declared in <bdlt_currenttime.h>

struct CurrentTime;

Description

This struct provides a namespace for current-time-retrieval procedures including a configurable global callback mechanism. The use of a subset of these procedures is thread-safe (see Thread Safety).

Type Aliases

NameDescription
CurrentTimeCallback Callback function type that returns the current time as a time interval.

Static Member Functions

NameDescription
asDatetimeTz Return the current local date/time with its UTC offset.
currentTimeCallback Return the installed function used to retrieve the interval between EpochUtil::epoch() and the current date/time.
currentTimeDefault Provide the default current-time callback implementation.
local Return the current date/time in the local time zone.
now Return the current date/time as a time interval from the epoch.
setCurrentTimeCallback Set the callback used to retrieve the current time.
utc Return the current date/time in Coordinated Universal Time (UTC).