On this page:
9.0
top
up

13Datetime ArithmeticπŸ”— i

An interface that defines datetime arithmetic operations. It is implemented by all objects that satisfy datetime? , moment? , or period? .

procedure

( datetime-arithmetic-provider? x)boolean

x:any/c
Returns #t if x implements gen:datetime-arithmetic-provider ; #f otherwise.

Adds or subtracts p to/from dt, returning a fresh datetime arithmetic provider the same type as dt.

Examples:
> (+period (datetime 1970)(period [years 5][hours 2]))

#<datetime 1975εΉ΄01月01ζ—₯T02:00:00>

> (-period (moment 2015383#:tz"America/New_York")(hours 2))

#<moment 2015εΉ΄03月08ζ—₯T00:00:00-05:00[America/New_York]>

> (+period (years 10)(years -5))

#<period of 5 years>

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /