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

duration

Arguments: durationspec &key start end

Returns the duration denoted by durationspec. durationspec should be a duration specifyier. start and end are bounding index designators of durationspec. The defaults for start and end are 0 and nil, respectively.

Note the difference between a duration designator and a time-interval designator of a duration. A time-interval designator specifies that a duration begin with the character #\P, as, for example, in "P1Y2MT5H". The corresponding duration designator does not include the initial #\P and would be "1Y2MT5H".

Examples

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

(duration-years (duration "2Y10M15DT10H30M20S")) => 2
(duration-months (duration "00021015T103020")) => 10

See also duration-years, duration-months, duration-weeks, duration-days, duration-hours, duration-minutes, duration-seconds, time-interval, add-duration, subtract-duration.

See date-time.htm for information on support in Allegro CL for parsing and generating time expressions using the ISO 8601 standard.


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