BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlt::LocalTimeOffset Struct Reference

#include <bdlt_localtimeoffset.h>

Public Types

typedef bsls::TimeInterval(* LocalTimeOffsetCallback) (const Datetime &utcDatetime)
 

Static Public Member Functions

static bsls::TimeInterval localTimeOffset (const Datetime &utcDatetime)
 
static bsls::TimeInterval localTimeOffsetDefault (const Datetime &utcDatetime)
 
static LocalTimeOffsetCallback setLocalTimeOffsetCallback (LocalTimeOffsetCallback callback)
 
static LocalTimeOffsetCallback localTimeOffsetCallback ()
 Return the currently installed LocalTimeOffsetCallback function.
 

Detailed Description

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).

Member Typedef Documentation

◆ LocalTimeOffsetCallback

typedef bsls::TimeInterval(* bdlt::LocalTimeOffset::LocalTimeOffsetCallback) (const Datetime &utcDatetime)

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.

Member Function Documentation

◆ localTimeOffset()

bsls::TimeInterval bdlt::LocalTimeOffset::localTimeOffset ( const Datetime utcDatetime)
inlinestatic

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()

LocalTimeOffset::LocalTimeOffsetCallback bdlt::LocalTimeOffset::localTimeOffsetCallback ( )
inlinestatic

◆ localTimeOffsetDefault()

static bsls::TimeInterval bdlt::LocalTimeOffset::localTimeOffsetDefault ( const Datetime utcDatetime)
static

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()

LocalTimeOffset::LocalTimeOffsetCallback bdlt::LocalTimeOffset::setLocalTimeOffsetCallback ( LocalTimeOffsetCallback  callback)
inlinestatic

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.


The documentation for this struct was generated from the following file: