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.
Declared in <baltzo_timezoneutil.h>
struct TimeZoneUtil;
These utility functions are: * alias-safe * exception-neutral (agnostic) * thread-safe For terminology see {bsldoc_glossary}.
| Name | Description |
|---|---|
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(). |
convertLocalToLocalTime | convertLocalToLocalTime overloads |
convertLocalToUtc | convertLocalToUtc overloads |
convertUtcToLocalTime | convertUtcToLocalTime overloads |
initLocalTime | initLocalTime overloads |
loadLocalTimePeriod | loadLocalTimePeriod overloads |
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. |
now | Load the current local time into result. |
validateLocalTime | validateLocalTime overloads |