Generic FunctionPackage:
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version


Arguments: date-time

Returns the year (an integer) of the date represented in date-time if that value can be calculated by non-nil slots in date-time, and returns nil otherwise. date-time must be a date-time object.

There is no year slot in a date-time instance. This function calculates its value from other slots (such as ymd-yd-century and ymd-yd-year-in-century). If nil is returned, it may be because the date-time is not complete (so needed slots are not filled in) or because the date portion is incomplete (needed information is not available, such as when a relative date -- "85-10-10" -- is all that is provided.) In the first case, applying complete-date-time will fill in needed slots. In the second case, it will not.

(require :datetime)

;; date-time is 1985/04/12 10:15:30, that is 15 and a half
;; minutes after 10 AM April 12, 1985.
(setq a (date-time "1985-04-12T10:15:30"))
(date-time-year a) -> 1985

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-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.
Created 2009.7.29.

Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version