Generic FunctionPackage: util.date-timeToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 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-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version