[#BloombergLP-baltzo-TimeZoneUtil] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baltzo.adoc[baltzo]::TimeZoneUtil :relfileprefix: ../../ :mrdocs: This `struct` provides a namespace for utility functions that convert time values to, from, and between, their corresponding local time representations in (possibly) different time zones. == Synopsis Declared in `<baltzo_timezoneutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct TimeZoneUtil; ---- == Description These utility functions are: * _alias‐safe_ * _exception‐neutral_ (agnostic) * _thread‐safe_ For terminology see {`bsldoc_glossary`}. == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/baltzo/TimeZoneUtil/addInterval.adoc[`addInterval`] | Load, into the specified `result`, the local time value that is the specified `interval` in the future of the specified `originalTime` (in the time zone `originalTime.timeZoneId()`). 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. The resulting local‐time is equivalent to adding `interval` to `originalTime.datetimeTz().utcDatetime()` and converting the result into the local time of `originalTime.timeZoneId()`. | xref:BloombergLP/baltzo/TimeZoneUtil/convertLocalToLocalTime-01.adoc[`convertLocalToLocalTime`] | `convertLocalToLocalTime` overloads | xref:BloombergLP/baltzo/TimeZoneUtil/convertLocalToUtc-0f.adoc[`convertLocalToUtc`] | `convertLocalToUtc` overloads | xref:BloombergLP/baltzo/TimeZoneUtil/convertUtcToLocalTime-0ec.adoc[`convertUtcToLocalTime`] | `convertUtcToLocalTime` overloads | xref:BloombergLP/baltzo/TimeZoneUtil/initLocalTime-09e2.adoc[`initLocalTime`] | `initLocalTime` overloads | xref:BloombergLP/baltzo/TimeZoneUtil/loadLocalTimePeriod-05.adoc[`loadLocalTimePeriod`] | `loadLocalTimePeriod` overloads | xref:BloombergLP/baltzo/TimeZoneUtil/loadLocalTimePeriodForUtc.adoc[`loadLocalTimePeriodForUtc`] | Load, into the specified `result`, attributes characterizing local time at the specified `utcTime` in the time zone indicated by the specified `timeZoneId` (i.e., the offset from UTC, whether daylight‐saving time is in effect and the description of the time zone), as well as the time interval over which those attributes apply. Return 0 on success, and a non‐zero value with no effect otherwise. A return value of `ErrorCode::k_UNSUPPORTED_ID` indicates that `timeZoneId` was not recognized. | xref:BloombergLP/baltzo/TimeZoneUtil/now-0f.adoc[`now`] | Load the current local time into `result`. | xref:BloombergLP/baltzo/TimeZoneUtil/validateLocalTime-0b.adoc[`validateLocalTime`] | `validateLocalTime` overloads |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#