The format-seconds Reference Manual

This is the format-seconds Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Fri May 15 12:19:07 2026 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 format-seconds

Format durations in seconds as human-friendly strings

Author

contrapunctus

License

Unlicense

Version

0.0.1

Dependency

cl-ppcre (system).

Source

format-seconds.asd.

Child Component

src/ (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 format-seconds/src/

Source

format-seconds.asd.

Parent Component

format-seconds (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 format-seconds/format-seconds.asd

Source

format-seconds.asd.

Parent Component

format-seconds (system).

ASDF Systems

format-seconds.


4.1.2 format-seconds/src//package.lisp

Source

format-seconds.asd.

Parent Component

src/ (module).

Packages

format-seconds.


4.1.3 format-seconds/src//units.lisp

Dependency

package.lisp (file).

Source

format-seconds.asd.

Parent Component

src/ (module).

Public Interface
Internals

default-units (function).


4.1.4 format-seconds/src//core.lisp

Dependency

units.lisp (file).

Source

format-seconds.asd.

Parent Component

src/ (module).

Public Interface

format-seconds (function).

Internals

5 Packages

Packages are listed by definition order.


5.1 format-seconds

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Special variables

Special Variable: *units*

List of ‘unit’ instances, in decreasing order of size.

Package

format-seconds.

Source

units.lisp.


6.1.2 Ordinary functions

Function: format-seconds (destination control-string seconds)

Use FORMAT-STRING to format the number SECONDS.

The valid format specifiers are -
~y is the number of (365-day) years.
~o is the number of (30-day) months.
~w is the number of weeks.
~d is the number of days.
~h is the number of hours.
~m is the number of minutes.
~s is the number of seconds.
~z is a non-printing control flag (see below).
~~ is a literal "~".

Upper-case specifiers are followed by the unit-name (e.g. "years"). Lower-case specifiers return only the unit.

"~" may be followed by any prefix parameters and "’" and/or "@", as acceptable to the ~D ‘format’ directive.

The "~z" specifier does not print anything. When it is used, specifiers must be given in order of decreasing size. To the left of "~z", nothing is output until the first non-zero unit is encountered.

Package

format-seconds.

Source

core.lisp.

Function: make-unit (name directive seconds)
Package

format-seconds.

Source

units.lisp.


6.1.3 Generic functions

Generic Reader: directive (object)
Generic Writer: (setf directive) (object)
Package

format-seconds.

Methods
Reader Method: directive ((unit unit))
Writer Method: (setf directive) ((unit unit))

The string (without the ~ prefix) used
to specify this unit in the control string.

Source

units.lisp.

Target Slot

directive.

Generic Reader: name (object)
Generic Writer: (setf name) (object)
Package

format-seconds.

Methods
Reader Method: name ((unit unit))
Writer Method: (setf name) ((unit unit))

The name of this unit as singular word.

Source

units.lisp.

Target Slot

name.

Generic Reader: seconds (object)
Generic Writer: (setf seconds) (object)
Package

format-seconds.

Methods
Reader Method: seconds ((unit unit))
Writer Method: (setf seconds) ((unit unit))

How many seconds this unit is equivalent to.

Source

units.lisp.

Target Slot

seconds.


6.1.4 Classes

Class: unit
Package

format-seconds.

Source

units.lisp.

Direct methods
Direct slots
Slot: name

The name of this unit as singular word.

Type

string

Initform

(error "empty `name' slot.")

Initargs

:name

Readers

name.

Writers

(setf name).

Slot: directive

The string (without the ~ prefix) used
to specify this unit in the control string.

Type

string

Initform

(error "empty `directive' slot.")

Initargs

:directive

Readers

directive.

Writers

(setf directive).

Slot: seconds

How many seconds this unit is equivalent to.

Type

integer

Initform

(error "empty `seconds' slot.")

Initargs

:seconds

Readers

seconds.

Writers

(setf seconds).


6.2 Internals


6.2.1 Special variables

Special Variable: *debug*

If non-nil, print debugging information to *debug-io*.

Package

format-seconds.

Source

core.lisp.


6.2.2 Ordinary functions

Function: debug-format (control-string &rest args)
Package

format-seconds.

Source

core.lisp.

Function: default-units ()

Return a list of default units.

Package

format-seconds.

Source

units.lisp.

Function: format-seconds-1 (seconds divisor prefix-params &optional unit)

Return the result of dividing SECONDS by DIVISOR as a string.

PREFIX-PARAMS is a string acceptable to the "~D" directive in ‘format’.

If UNIT is non-nil, it is inserted after the string. If SECONDS is 0 or >1, UNIT is suffixed with "s". e.g. if UNIT is "second", values of 0, 1 and 2 SECONDS will result in "0 seconds", "1 second", and "2 seconds" respectively.

Package

format-seconds.

Source

core.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
D   F   G   M   N   S  
Index Entry  Section

(
(setf directive): Public generic functions
(setf directive): Public generic functions
(setf name): Public generic functions
(setf name): Public generic functions
(setf seconds): Public generic functions
(setf seconds): Public generic functions

D
debug-format: Private ordinary functions
default-units: Private ordinary functions
directive: Public generic functions
directive: Public generic functions

F
format-seconds: Public ordinary functions
format-seconds-1: Private ordinary functions
Function, debug-format: Private ordinary functions
Function, default-units: Private ordinary functions
Function, format-seconds: Public ordinary functions
Function, format-seconds-1: Private ordinary functions
Function, make-unit: Public ordinary functions

G
Generic Function, (setf directive): Public generic functions
Generic Function, (setf name): Public generic functions
Generic Function, (setf seconds): Public generic functions
Generic Function, directive: Public generic functions
Generic Function, name: Public generic functions
Generic Function, seconds: Public generic functions

M
make-unit: Public ordinary functions
Method, (setf directive): Public generic functions
Method, (setf name): Public generic functions
Method, (setf seconds): Public generic functions
Method, directive: Public generic functions
Method, name: Public generic functions
Method, seconds: Public generic functions

N
name: Public generic functions
name: Public generic functions

S
seconds: Public generic functions
seconds: Public generic functions