This struct provides a namespace for local‐time‐offset procedures including a configurable global callback mechanism. The use of these procedures is thread‐safe (see Thread Safety).

Synopsis

Declared in <bdlt_localtimeoffset.h>

struct LocalTimeOffset;

Type Aliases

Name

Description

LocalTimeOffsetCallback

LocalTimeOffsetCallback is an alias for the type of a function that returns a bsls::TimeInterval value representing the difference between local time and UTC time at the specified utcDatetime. This function must be thread‐safe in multi‐threaded builds. Note that the installed callback function must have geographic information specifying the local timezone.

Static Member Functions

Name

Description

localTimeOffset

Return a bsls::TimeInterval value representing the difference between local time and UTC time at the specified utcDatetime. This method uses the currently installed local‐time‐offset callback mechanism.

localTimeOffsetCallback

Return the currently installed LocalTimeOffsetCallback function.

localTimeOffsetDefault

Return a bsls::TimeInterval value representing the difference between local time and UTC time at the specified utcDatetime. Note that the local time zone is determined by the TZ environment variable in the same manner as the localtime POSIX function.

setLocalTimeOffsetCallback

Set the specified callback as the function to be used to return a bsls::TimeInterval value representing the difference between local time and UTC time at a specified UTC date and time. Return the previously installed LocalTimeOffsetCallback function. The behavior is undefined unless 0 != callback.

Created with MrDocs