[#BloombergLP-baltzo-TimeZoneUtil-addInterval]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baltzo.adoc[baltzo]::xref:BloombergLP/baltzo/TimeZoneUtil.adoc[TimeZoneUtil]::addInterval
:relfileprefix: ../../../
:mrdocs:

Add `interval` to `originalTime` in its local time zone&period;

== Synopsis

Declared in `&lt;baltzo&lowbar;timezoneutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
addInterval(
    xref:BloombergLP/baltzo/LocalDatetime.adoc[LocalDatetime]* result,
    xref:BloombergLP/baltzo/LocalDatetime.adoc[LocalDatetime] const& originalTime,
    xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& interval);
----

== Description

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&period;timeZoneId()`)&period; Return 0 on success, and a non&hyphen;zero value with no effect otherwise&period; A return value of `ErrorCode&colon;&colon;k&lowbar;UNSUPPORTED&lowbar;ID` indicates that `targetTimeZoneId` was not recognized, and a return value of `ErrorCode&colon;&colon;k&lowbar;OUT&lowbar;OF&lowbar;RANGE` indicates that the result of the operation would have been outside the range of values representable by the `result` type&period; The resulting local&hyphen;time is equivalent to adding `interval` to `originalTime&period;datetimeTz()&period;utcDatetime()` and converting the result into the local time of `originalTime&period;timeZoneId()`&period;

== Return Value

0 on success, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *result*
| receives the local time after adding `interval`
| *originalTime*
| local time from which to start
| *interval*
| time interval to add to `originalTime`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
