Validate that localTime matches time‐zone data for timeZoneId.

Synopsis

Declared in <baltzo_timezoneutil.h>

static
int
validateLocalTime(
    bool* result,
    bdlt::DatetimeTz const& localTime,
    char const* timeZoneId);

Description

Load, into the specified result, true if the offset from UTC of the specified localTime (i.e., localTime.offset()) is consistent with the actual local time offset, as indicated by time zone data, at the UTC time localTime.utcDatetime() in the time zone indicated by the specified timeZoneId, and false otherwise. Return 0 on success, and a non‐zero value with false loaded into result otherwise. A return value of ErrorCode::k_UNSUPPORTED_ID indicates that timeZoneId is not recognized. Note that this operation verifies that the properties of the provided local time are consistent with the time zone data.

Return Value

0 on success, and a non‐zero value otherwise

Parameters

Name

Description

result

receives whether localTime is consistent with the data

localTime

local date‐time whose offset is validated

timeZoneId

identifier of the time zone used for validation

Created with MrDocs