Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

baltzo::TimeZoneUtilImp Struct Reference

#include <baltzo_timezoneutilimp.h>

List of all members.

Static Public Member Functions

static int convertUtcToLocalTime (bdlt::DatetimeTz *result, const char *resultTimeZoneId, const bdlt::Datetime &utcTime, ZoneinfoCache *cache)
static void createLocalTimePeriod (LocalTimePeriod *result, const Zoneinfo::TransitionConstIterator &transition, const Zoneinfo &timeZone)
static int initLocalTime (bdlt::DatetimeTz *result, LocalTimeValidity::Enum *resultValidity, const bdlt::Datetime &localTime, const char *timeZoneId, DstPolicy::Enum dstPolicy, ZoneinfoCache *cache)
static int loadLocalTimePeriodForUtc (LocalTimePeriod *result, const char *timeZoneId, const bdlt::Datetime &utcTime, ZoneinfoCache *cache)
static void resolveLocalTime (bdlt::DatetimeTz *result, LocalTimeValidity::Enum *resultValidity, Zoneinfo::TransitionConstIterator *transitionIter, const bdlt::Datetime &localTime, DstPolicy::Enum dstPolicy, const Zoneinfo &timeZone)

Detailed Description

This struct provides a namespace for utility functions that convert time values to, and from, local time.

See Component baltzo_timezoneutilimp


Member Function Documentation

static int baltzo::TimeZoneUtilImp::convertUtcToLocalTime ( bdlt::DatetimeTz result,
const char *  resultTimeZoneId,
const bdlt::Datetime utcTime,
ZoneinfoCache cache 
) [static]

Load, into the specified result, the local date-time value, in the time zone indicated by the specified resultTimeZoneId, corresponding to the specified utcTime, using time zone information supplied by the specified cache. Return 0 on success, and a non-zero value otherwise. A return status of ErrorCode::k_UNSUPPORTED_ID indicates that resultTimeZoneId is not recognized, and a return status of ErrorCode::k_OUT_OF_RANGE indicates that an out of range value of result would have occurred.

static void baltzo::TimeZoneUtilImp::createLocalTimePeriod ( LocalTimePeriod result,
const Zoneinfo::TransitionConstIterator transition,
const Zoneinfo timeZone 
) [static]

Load, into the specified result, attributes characterizing local time indicated by the specified transition in the specified timeZone. The behavior is undefined unless ZoneinfoUtil::isWellFormed(timeZone) is true and transition is a valid, non-ending, iterator into the sequence of transitions described by timeZone.

static int baltzo::TimeZoneUtilImp::initLocalTime ( bdlt::DatetimeTz result,
LocalTimeValidity::Enum resultValidity,
const bdlt::Datetime localTime,
const char *  timeZoneId,
DstPolicy::Enum  dstPolicy,
ZoneinfoCache cache 
) [static]

Load, into the specified result, the local date-time value -- including the local date, time, and resolved UTC offset -- indicated by the specified localTime in the time zone indicated by the specified timeZoneId, using the specified dstPolicy to interpret whether or not localTime represents a daylight-saving time value, and using time zone information supplied by the specified cache. Load, into the specified resultValidity the value indicating the whether localTime is unique, ambiguous but valid, or invalid. Return 0 on success, and a non-zero value otherwise. A return status of ErrorCode::k_UNSUPPORTED_ID indicates that timeZoneId is not recognized.

static int baltzo::TimeZoneUtilImp::loadLocalTimePeriodForUtc ( LocalTimePeriod result,
const char *  timeZoneId,
const bdlt::Datetime utcTime,
ZoneinfoCache cache 
) [static]

Load, into the specified result, attributes characterizing local time at the specified utcTime in the time zone indicated by the specified timeZoneId (e.g., the offset from UTC, whether it is daylight-saving time), as well as the time interval over which those attributes apply, using time zone information supplied by the specified cache. Return 0 on success, and a non-zero value otherwise. A return status of ErrorCode::k_UNSUPPORTED_ID indicates that timeZoneId is not recognized.

static void baltzo::TimeZoneUtilImp::resolveLocalTime ( bdlt::DatetimeTz result,
LocalTimeValidity::Enum resultValidity,
Zoneinfo::TransitionConstIterator transitionIter,
const bdlt::Datetime localTime,
DstPolicy::Enum  dstPolicy,
const Zoneinfo timeZone 
) [static]

Load, into the specified result, the local time and UTC offset of the specified localTime in the specified timeZone, using the specified dstPolicy to interpret whether or not localTime represents a daylight-saving time value; load into the specified resultValidity an indication of whether localTime is valid and unique, valid but ambiguous, or invalid; load into the specified transitionIter an iterator pointing to the transition that characterizes the attributes of localTime. The behavior is undefined unless ZoneinfoUtil::isWellFormed(timeZone) is true.


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