Timedelta
this is a complementary module to be used with Datetime
and
is concerned with adding and subtracting time values of the scale from seconds
to weeks from Datetime
values.
Example:
(load "git@github.com:carpentry-org/time.carp@0.1.0")
(defn main []
(println*
&(Datetime.strftime
&(Timedelta.sub &(Datetime.now) &(Timedelta.days 2))
"%Y-%m-%d %I:%M:%S.%n %p %z")))
add
defn
(Fn [(Ref Datetime a), (Ref Timedelta b)] Datetime)
(add dt delta)
adds a Timedelta
delta
to a Datetime
dt
.
sub
defn
(Fn [(Ref Datetime a), (Ref Timedelta b)] Datetime)
(sub dt delta)
subtracts a Timedelta
delta
from a Datetime
dt
.