[#BloombergLP-baltzo-TimeZoneUtil-convertLocalToLocalTime-06] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baltzo.adoc[baltzo]::xref:BloombergLP/baltzo/TimeZoneUtil.adoc[TimeZoneUtil]::convertLocalToLocalTime :relfileprefix: ../../../ :mrdocs: Convert `srcTime` in `srcTimeZoneId` to local time in `targetTimeZoneId`. == Synopsis Declared in `<baltzo_timezoneutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int convertLocalToLocalTime( xref:BloombergLP/baltzo/LocalDatetime.adoc[LocalDatetime]* result, char const* targetTimeZoneId, xref:BloombergLP/bdlt/Datetime.adoc[bdlt::Datetime] const& srcTime, char const* srcTimeZoneId, xref:BloombergLP/baltzo/DstPolicy/Enum.adoc[DstPolicy::Enum] dstPolicy = DstPolicy::e_UNSPECIFIED); ---- == Description 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. == Return Value 0 on success, and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *result* | receives the converted local date‐time | *targetTimeZoneId* | identifier of the destination time zone | *srcTime* | local date‐time in the source time zone | *srcTimeZoneId* | identifier of the source time zone | *dstPolicy* | daylight‐saving policy for interpreting `srcTime` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#