minus
minus subtracts one time period from another.
Syntax
minus(instant, nanos)
minus(instant, duration)
minus(instant1, instant2)
minus(instant, period)
minus(dateTime, nanos)
minus(dateTime, duration)
minus(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 minus the specified time period.
Examples
d1 = parseInstant("2020-01-02T00:00:00 ET")
d2 = parseInstant("2020-01-01T00:00:00 ET")
println minus(d1, d2)