FunctionPackage: util.date-timeToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

subtract-duration

Arguments: date-timespec durationspec

Returns a new date-time object obtained by subtracting the duration specified by durationspec from the date-time specified by date-timespec.

The default method does not subtract two durations.

 > (require :datetime)
 > (use-package :util.date-time)

 > (subtract-duration (date-time "1985-04-10T10:30:40") 
         (duration "1MT1H4S"))
 #<date-time "1985-03-10T09:30:36" @ ...>

See duration, date-time, and add-duration.

See date-time.htm for information on support in Allegro CL for parsing and generating time expressions using the ISO 8601 standard. See particularly the section Adding/Subtracting Durations, where it is pointed out (with examples) that adding and subtracting durations are not inverse operations and adding durations is not associative.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version