Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

baltzo::LocalTimeOffsetUtil Struct Reference

#include <baltzo_localtimeoffsetutil.h>

List of all members.

Static Public Member Functions

static void loadLocalTimeOffset (int *result, const bdlt::Datetime &utcDatetime)
static bsls::TimeInterval localTimeOffset (const bdlt::Datetime &utcDatetime)
static
bdlt::LocalTimeOffset::LocalTimeOffsetCallback 
setLoadLocalTimeOffsetCallback ()
static int configure ()
static int configure (const char *timezone)
static int configure (const char *timezone, const bdlt::Datetime &utcDatetime)
static void loadLocalTimePeriod (LocalTimePeriod *localTimePeriod)
static void loadTimezone (bsl::string *timezone)
static void loadTimezone (std::string *timezone)
static int updateCount ()

Detailed Description

This struct provides a namespace for a bdlt::LocalTimeOffset local time offset callback, and functions that manage the timezone information reported by that callback. All public methods are thread-safe.

See Component baltzo_localtimeoffsetutil


Member Function Documentation

static void baltzo::LocalTimeOffsetUtil::loadLocalTimeOffset ( int *  result,
const bdlt::Datetime utcDatetime 
) [static]

DEPRECATED: Use localTimeOffset instead.

Efficiently load to the specified result the offset of the local time from UTC for the specified utcDatetime. This function is thread-safe. The behavior is undefined unless the local time zone has been previously established by a call to the configure method. This method is thread-safe. Note that this function is no longer used as a callback function. It exisis for backwards compatibility with code that called it directly, and is deprecated.

static bsls::TimeInterval baltzo::LocalTimeOffsetUtil::localTimeOffset ( const bdlt::Datetime utcDatetime  )  [static]

Return the offset of the local time from UTC for the specified utcDatetime. This function is thread-safe. The behavior is undefined unless the local time zone has been previously established by a call to the configure method. This method is thread-safe.

static bdlt::LocalTimeOffset::LocalTimeOffsetCallback baltzo::LocalTimeOffsetUtil::setLoadLocalTimeOffsetCallback (  )  [static]

Set localTimeOffset as the local time offset callback of bdlt::CurrentTime. Return the previously installed callback. This method is not thread-safe.

static int baltzo::LocalTimeOffsetUtil::configure (  )  [static]

Set the local time period information used by the localTimeOffset method to that for the time zone in the TZ environment variable at the current UTC datetime. Return 0 on success, and a non-zero value otherwise. This method is not thread-safe. The behavior is undefined if the environment changes (e.g., a call to the putenv POSIX function) during the invocation of this method.

static int baltzo::LocalTimeOffsetUtil::configure ( const char *  timezone  )  [static]

Set the local time period information used by the localTimeOffset method to that for specified timezone at the current UTC datetime. Return 0 on success, and a non-zero value otherwise. This method is not thread-safe.

static int baltzo::LocalTimeOffsetUtil::configure ( const char *  timezone,
const bdlt::Datetime utcDatetime 
) [static]

Set the local time period information used by the localTimeOffset method to that for the specified timezone at the specified utcDatetime. Return 0 on success, and a non-zero value otherwise. This method is not thread-safe.

static void baltzo::LocalTimeOffsetUtil::loadLocalTimePeriod ( LocalTimePeriod localTimePeriod  )  [static]

Load to the specified localTimePeriod the local time period information currently used by the localTimeOffset method. That information is updated when localTimeOffset is called with a utcDatetime outside the range localTimePeriod().utcStartTime() (inclusive) localTimePeriod().utcEndTime() (exclusive). This method is not thread-safe. The behavior is undefined if this method is invoked before the successful invocation of a configure method.

static void baltzo::LocalTimeOffsetUtil::loadTimezone ( bsl::string timezone  )  [static]
static void baltzo::LocalTimeOffsetUtil::loadTimezone ( std::string *  timezone  )  [static]

Load to the specified timezone time zone identifier used to determine the local time offset from UTC. This method is not thread-safe. The behavior is undefined if this method is invoked before the successful invocation of a configure method.

static int baltzo::LocalTimeOffsetUtil::updateCount (  )  [static]

Return the number of successful updates of the local time period information since the start of the process. This count is incremented on calls to any of the setTimeZone methods and when loadLocalTimePeriod is called with a utcDatetime outside the range of the current local time period information. This method is thread-safe.


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