BloombergLP::baltzo::TimeZoneUtil::convertUtcToLocalTime

Convert utcTime to local time in targetTimeZoneId.

Synopsis

Declared in <baltzo_timezoneutil.h>

static
int
convertUtcToLocalTime(
    LocalDatetime* result,
    char const* targetTimeZoneId,
    bdlt::Datetime const& utcTime);

Description

Load, into the specified result, the local date-time value (in the time zone indicated by the specified targetTimeZoneId) corresponding to the specified utcTime. The offset from UTC of the time zone 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 targetTimeZoneId was not recognized, and a return value of ErrorCode::k_OUT_OF_RANGE indicates that the result of the operation would have been outside the range of values representable by the result type.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
resultreceives the converted local date-time
targetTimeZoneIdidentifier of the destination time zone
utcTimeUTC date-time to convert