BloombergLP::baltzo::TimeZoneUtil::convertLocalToLocalTime

Load, into the specified result, the local date-time value (in the time zone indicated by the specified targetTimeZoneId) corresponding to the local time indicated by the specified srcTime (in the time zone indicated by the specified srcTimeZoneId). Optionally specify a dstPolicy indicating whether or not srcTime represents a daylight-saving time value. If dstPolicy is unspecified and srcTime is a unique and valid time in the source time zone, then perform the conversion using that uniquely described time; if dstPolicy is unspecified and srcTime is either ambiguous or invalid, then use the later of the two possible interpretations of srcTime. The offset from UTC of both time zones is rounded down to minute precision. Return 0 on success, and a non-zero value with no effect otherwise. A return value of ErrorCode::k_UNSUPPORTED_ID indicates that either targetTimeZoneId or srcTimeZoneId was not recognized.

Synopsis

Declared in <baltzo_timezoneutil.h>

static
int
convertLocalToLocalTime(
    LocalDatetime* result,
    char const* targetTimeZoneId,
    bdlt::Datetime const& srcTime,
    char const* srcTimeZoneId,
    DstPolicy::Enum dstPolicy = DstPolicy::e_UNSPECIFIED);