BloombergLP::baltzo::TimeZoneUtilImp::initLocalTime

Initialize local time in timeZoneId from localTime.

Synopsis

Declared in <baltzo_timezoneutilimp.h>

static
int
initLocalTime(
    bdlt::DatetimeTz* result,
    LocalTimeValidity::Enum* resultValidity,
    bdlt::Datetime const& localTime,
    char const* timeZoneId,
    DstPolicy::Enum dstPolicy,
    ZoneinfoCache* cache);

Description

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. The behavior is undefined unless the result of the initialization falls within the supported epoch.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
resultreceives the initialized local date-time
resultValidityreceives the validity of localTime
localTimelocal date-time to interpret
timeZoneIdidentifier of the time zone for localTime
dstPolicydaylight-saving policy for interpreting localTime
cachezoneinfo cache supplying time zone data