Date and Time

The time class defines both calendar time and time period.




time [class]


  :super   propertied-object 

:slots (micro second minute hour day month weekday year
timezone dst seconds)


defines time objects.


:now [method]

(instance time :now) creates a time object for the current time.


:init &optional sec micro dst tzone [method]

creates a time object which represents sec second after January 1, 1970.


:make &key (year 1970) (month 0) (day 1) (weekday 4) (hour 0) (minute 0) (second 0) (micro 0) (timezone (* -9 3600))) [method]

creates a time object which is represented by a calendar notation. The timezone is defaulted to JST.


:year [method]

returns the year component of the time object. Note that the year is represented in a full (four) digit notation, not the least two digits.


:month [method]

returns the month component of the time object. Note that the month begins from 0 for January.


:day [method]

returns the day component of the time object. Note that the day begins from 1 for the first of a month.


:weekday [method]

returns the weekday component of the time object. Note that the weekday begins from 0 for Sunday.


:hour [method]

returns the hour component of the time object in 24-hour representation. Note that the hour ranges from 0 to 23.


:minute [method]

returns the minute component of the time object. Note that the hour ranges from 0 to 59.


:second [method]

returns the second component of the time object. Note that the hour ranges from 0 to 59.


:seconds [method]

returns the seconds component of the time object. Seconds represents time after the origin of the unix time, i.e., the midnight of January 1, 1970.


:year-day [method]

returns the number of days after the beginning of the year. For example, year-day of a time object representing February 2nd is 32.


:difference atime [method]

returns a new time object representing the time difference of self from atime.


:add atime [method]

returns a new time object representing the added time of self and atime.


This document was generated using the LaTeX2HTML translator on Sat Feb 5 14:36:57 JST 2022 from EusLisp version 138fb6ee Merge pull request #482 from k-okada/apply_dfsg_patch