Next: Parsing and Formatting, Previous: Querying timestamp Objects, Up: Public API [Contents][Index]
Add or subtract the amount to the time using the specified
unit. unit may be one of ( :nsec
:sec
:minute
:hour
:day
:month
:year
).
The value of the parts of the timestamp of higher resolution than the
UNIT will never be touched. If you want a precise number of seconds
from a time, you should specify the offset in seconds.
Returns a timestamp with its parts maximized up to part. part can be any of (:nsec :sec :min :hour :day :month). If into is specified, it will be modified and returned, otherwise a new timestamp will be created.
Returns a timestamp with its parts minimized up to part. part can be any of (:nsec :sec :min :hour :day :month). If into is specified, it will be modified and returned, otherwise a new timestamp will be created.
Alters various parts of timestamp, given a list of changes. The
changes are in the format (offset part value)
and (set
part value)
.
;; Return a newtimestamp
value that points to the previous Monday (adjust-timestamp (today) (offset :day-of-week :monday)) ;; Return a newtimestamp
value that points three days ahead from now (adjust-timestamp (today) (offset :day 3))
Keep in mind that adjust-timestamp
is not a mere setter for
fields but instead it handles overflows and timezone conversions as
expected. Also note that it’s possible to specify multiple commands.
The list of possible places to manipulate are: :nsec
:sec
:sec-of-day
:minute
:hour
:day
:day-of-month
:month
:year
.
Just like adjust-timestamp
, but instead of returning a freshly
constructed value, it alters the provided timestamp value (and
returns it).
Returns the number of whole years elapsed between time-a and time-b.
Note: This is useful for calculating anniversaries and birthdays.
Returns the number of days in a given month of the specified year.
Next: Parsing and Formatting, Previous: Querying timestamp Objects, Up: Public API [Contents][Index]