plus
plus adds one time period to another.
Syntax
plus(instant, nanos)
plus(instant, duration)
plus(instant1, instant2)
plus(instant, period)
plus(dateTime, nanos)
plus(dateTime, duration)
plus(dateTime1, dateTime2)
Parameters
| Parameter | Type | Description |
|---|---|---|
| instant | Instant | Starting instant value. |
| instant1 | Instant | Starting instant value. |
| dateTime | ZonedDateTime | Starting date-time value. |
| dateTime1 | ZonedDateTime | Starting date-time value. |
| nanos | long | Number of nanoseconds to subtract. |
| duration | Duration | The time period to subtract. |
| period | Period | The time period to subtract. |
| instant2 | Instant | The time period to subtract. |
| dateTime2 | ZonedDateTime | The time period to subtract. |
Returns
The starting time plus the specified time period.
Examples
dateTime = parseInstant("2020-01-02T00:00:00 ET")
duration = parseDuration("PT5H3M35S")
println plus(dateTime, duration)