# The time-interval Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

# The time-interval Reference Manual

This is the time-interval Reference Manual, version 0.0.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:40:03 2018 GMT+0.

Next: , Previous: , Up: Top   [Contents][Index]

# time-interval

Cyrus Harmon

time-interval is a common lisp library for flexibly encoding time intervals. It relies heavily on the local-time library for the representation of particular points in time, or as local-time calls them, timestamps.

The primary motivation for time-interval is to be able to represent periods of time such as "6 months from July 1, 2008". The idea here isn't to represent the start and dates (or times) explicitly, but rather to flexibly represent the interval. The difficulty arises from the fact that a length of time such as "6 months" can't be uniquely represented as a number of days, hours, minutes, etc... Depending on what the starting point is, the number of days (hours, etc...) in a 6-month interval will change. Therefore, we need a way of representing the time intervals and for computing a new exact time given a starting time and a time interval.

# Required Libraries:

cl-ppcre, local-time

# Classes:

## time-interval

The time-interval class is used for representing a given interval of time, such as 6 months, 2 days, 4 hours and 3 seconds. Each of the components can independenly be positive or negative, so we can have, for instance, an interval that represents 1 hour less than two days, by doing:

``````(make-instance 'time-interval :hours -1 :days 2)
``````

or:

``````(time-interval :hours -1 :days 2)
``````

Next: , Previous: , Up: Top   [Contents][Index]

## 2 Systems

The main system appears first, followed by any subsystem dependency.

Previous: , Up: Systems   [Contents][Index]

### 2.1 time-interval

Author

Cyrus Harmon <ch-lisp@bobobeach.com>

BSD

Description

A library for representing intervals of time

Version

0.0.1

Dependencies
• cl-ppcre
• local-time
Source

time-interval.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

## 3 Files

Files are sorted by type and then listed depth-first from the systems components trees.

Next: , Previous: , Up: Files   [Contents][Index]

### 3.1 Lisp

Next: , Previous: , Up: Lisp files   [Contents][Index]

#### 3.1.1 time-interval.asd

Location

time-interval.asd

Systems

time-interval (system)

Next: , Previous: , Up: Lisp files   [Contents][Index]

#### 3.1.2 time-interval/package.lisp

Dependency

Parent

time-interval (system)

Location

package.lisp

Packages

Previous: , Up: Lisp files   [Contents][Index]

#### 3.1.3 time-interval/time-interval.lisp

Dependency

package.lisp (file)

Parent

time-interval (system)

Location

time-interval.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Files   [Contents][Index]

### 3.2 Other

Next: , Previous: , Up: Other files   [Contents][Index]

Parent

time-interval (system)

Location

Previous: , Up: Other files   [Contents][Index]

Dependency

Parent

time-interval (system)

Location

Next: , Previous: , Up: Top   [Contents][Index]

## 4 Packages

Packages are listed by definition order.

Previous: , Up: Packages   [Contents][Index]

### 4.1 time-interval

Source

package.lisp (file)

Nickname

interval

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

## 5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.

Next: , Previous: , Up: Definitions   [Contents][Index]

### 5.1 Exported definitions

Next: , Previous: , Up: Exported definitions   [Contents][Index]

#### 5.1.1 Functions

Function: copy-time-interval ORIG
Package
Source

time-interval.lisp (file)

Function: make-timestamp* &key YEAR MONTH DAY HOUR MINUTE SECOND NANOSECOND
Package
Source

time-interval.lisp (file)

Function: negate-time-interval ORIG
Package
Source

time-interval.lisp (file)

Function: parse-time-interval-string STRING
Package
Source

time-interval.lisp (file)

Function: time-interval &rest ARGS
Package
Source

time-interval.lisp (file)

Next: , Previous: , Up: Exported definitions   [Contents][Index]

#### 5.1.2 Generic functions

Generic Function: t+ TIME-OR-INTERVAL-1 TIME-OR-INTERVAL-2
Package
Source

time-interval.lisp (file)

Methods
Method: t+ (T1 time-interval) (T2 time-interval)
Method: t+ (T1 time-interval) (T2 timestamp)
Method: t+ (T1 timestamp) (T2 time-interval)
Generic Function: t- TIME-OR-INTERVAL-1 TIME-OR-INTERVAL-2
Package
Source

time-interval.lisp (file)

Methods
Method: t- (T1 time-interval) (T2 time-interval)
Method: t- (T1 timestamp) (T2 time-interval)

Previous: , Up: Exported definitions   [Contents][Index]

#### 5.1.3 Classes

Class: time-interval ()
Package
Source

time-interval.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: years
Initargs

:years

Initform

0

interval-years (generic function)

Writers

(setf interval-years) (generic function)

Slot: months
Initargs

:months

Initform

0

interval-months (generic function)

Writers

(setf interval-months) (generic function)

Slot: weeks
Initargs

:weeks

Initform

0

interval-weeks (generic function)

Writers

(setf interval-weeks) (generic function)

Slot: days
Initargs

:days

Initform

0

interval-days (generic function)

Writers

(setf interval-days) (generic function)

Slot: hours
Initargs

:hours

Initform

0

interval-hours (generic function)

Writers

(setf interval-hours) (generic function)

Slot: minutes
Initargs

:minutes

Initform

0

interval-minutes (generic function)

Writers

(setf interval-minutes) (generic function)

Slot: seconds
Initargs

:seconds

Initform

0

interval-seconds (generic function)

Writers

(setf interval-seconds) (generic function)

Slot: nanoseconds
Initargs

:nanoseconds

Initform

0

interval-nanoseconds (generic function)

Writers

(setf interval-nanoseconds) (generic function)

Previous: , Up: Definitions   [Contents][Index]

### 5.2 Internal definitions

Next: , Previous: , Up: Internal definitions   [Contents][Index]

#### 5.2.1 Special variables

Special Variable: *unit-hash*
Package
Source

time-interval.lisp (file)

Next: , Previous: , Up: Internal definitions   [Contents][Index]

#### 5.2.2 Macros

Macro: or-zero VALUE
Package
Source

time-interval.lisp (file)

Next: , Previous: , Up: Internal definitions   [Contents][Index]

#### 5.2.3 Functions

Package
Source

time-interval.lisp (file)

Previous: , Up: Internal definitions   [Contents][Index]

#### 5.2.4 Generic functions

Generic Function: interval-days OBJECT
Generic Function: (setf interval-days) NEW-VALUE OBJECT
Package
Methods
Method: interval-days (TIME-INTERVAL time-interval)

Source

time-interval.lisp (file)

Method: (setf interval-days) NEW-VALUE (TIME-INTERVAL time-interval)

automatically generated writer method

Source

time-interval.lisp (file)

Generic Function: interval-hours OBJECT
Generic Function: (setf interval-hours) NEW-VALUE OBJECT
Package
Methods
Method: interval-hours (TIME-INTERVAL time-interval)

Source

time-interval.lisp (file)

Method: (setf interval-hours) NEW-VALUE (TIME-INTERVAL time-interval)

automatically generated writer method

Source

time-interval.lisp (file)

Generic Function: interval-minutes OBJECT
Generic Function: (setf interval-minutes) NEW-VALUE OBJECT
Package
Methods
Method: interval-minutes (TIME-INTERVAL time-interval)

Source

time-interval.lisp (file)

Method: (setf interval-minutes) NEW-VALUE (TIME-INTERVAL time-interval)

automatically generated writer method

Source

time-interval.lisp (file)

Generic Function: interval-months OBJECT
Generic Function: (setf interval-months) NEW-VALUE OBJECT
Package
Methods
Method: interval-months (TIME-INTERVAL time-interval)

Source

time-interval.lisp (file)

Method: (setf interval-months) NEW-VALUE (TIME-INTERVAL time-interval)

automatically generated writer method

Source

time-interval.lisp (file)

Generic Function: interval-nanoseconds OBJECT
Generic Function: (setf interval-nanoseconds) NEW-VALUE OBJECT
Package
Methods
Method: interval-nanoseconds (TIME-INTERVAL time-interval)

Source

time-interval.lisp (file)

Method: (setf interval-nanoseconds) NEW-VALUE (TIME-INTERVAL time-interval)

automatically generated writer method

Source

time-interval.lisp (file)

Generic Function: interval-seconds OBJECT
Generic Function: (setf interval-seconds) NEW-VALUE OBJECT
Package
Methods
Method: interval-seconds (TIME-INTERVAL time-interval)

Source

time-interval.lisp (file)

Method: (setf interval-seconds) NEW-VALUE (TIME-INTERVAL time-interval)

automatically generated writer method

Source

time-interval.lisp (file)

Generic Function: interval-weeks OBJECT
Generic Function: (setf interval-weeks) NEW-VALUE OBJECT
Package
Methods
Method: interval-weeks (TIME-INTERVAL time-interval)

Source

time-interval.lisp (file)

Method: (setf interval-weeks) NEW-VALUE (TIME-INTERVAL time-interval)

automatically generated writer method

Source

time-interval.lisp (file)

Generic Function: interval-years OBJECT
Generic Function: (setf interval-years) NEW-VALUE OBJECT
Package
Methods
Method: interval-years (TIME-INTERVAL time-interval)

Source

time-interval.lisp (file)

Method: (setf interval-years) NEW-VALUE (TIME-INTERVAL time-interval)

automatically generated writer method

Source

time-interval.lisp (file)

Previous: , Up: Top   [Contents][Index]

## Appendix A Indexes

Next: , Previous: , Up: Indexes   [Contents][Index]

### A.1 Concepts

Next: , Previous: , Up: Indexes   [Contents][Index]

### A.2 Functions

Jump to: (   C   F   G   I   M   N   O   P   T
Jump to: (   C   F   G   I   M   N   O   P   T

Next: , Previous: , Up: Indexes   [Contents][Index]