@c =================================================================== @c
@c    serrano/prgm/project/bigloo/manuals/date.texi                    @c
@c    ------------------------------------------------------------     @c
@c    Author      :  Manuel Serrano                                    @c
@c    Creation    :  Wed Feb  5 17:17:13 2003                          @c
@c    Last change :                                                    @c
@c    Copyright   :  2003 Manuel Serrano                               @c
@c    ------------------------------------------------------------     @c
@c    Date manager                                                     @c
@c =================================================================== @c

@c ------------------------------------------------------------------- @c
@c    Date                                                             @c
@c ------------------------------------------------------------------- @c
@node Date, Posix Regular Expressions, System Programming, Standard Library
@comment  node-name,  next,  previous,  up
@section Date
@cindex Date
@cindex Calendar
@cindex Time

@deffn {bigloo procedure} date? obj
Returns @code{#t} if and only if @var{obj} is a @emph{date} as returned
by @code{make-date}, @code{current-date}, or @code{seconds->date}. It
returns @code{#f} otherwise.
@end deffn

@deffn {bigloo procedure} make-date sec min hour day mon year [timezone] [dst]
Creates a @code{date} object from the integer value passed as argument.

Example:
@smalllisp
(write (make-date 0 22 17 5 2 2003 0))
  @print{} #<date:Wed Feb  5 17:22:00 2003>
@end smalllisp

This argument @var{date} is either @code{-1} when the information is not
available, @code{0} when daylight saving is disabled, @code{1} when daylight
saving is enabled.
@end deffn

@deffn {bigloo procedure} date-copy date [s] [m] [h] [d] [m] [year]
Creates a new date from the argument @var{date}. 

Example:
@smalllisp
(date-copy (current-date) 1 0 0)
@end smalllisp

@end deffn

@deffn {bigloo procedure} current-date
Returns a @code{date} object representing the current date.
@end deffn

@deffn {bigloo procedure} current-seconds
Returns an @code{elong} integer representing the current date expressed
in seconds.
@end deffn

@deffn {bigloo procedure} date->seconds
@deffnx {bigloo procedure} seconds->date
Convert from @code{date} and @code{elong}.
@end deffn

@deffn {bigloo procedure} date->string date
@deffnx {bigloo procedure} date->utc-string date
@deffnx {bigloo procedure} seconds->string elong
@deffnx {bigloo procedure} seconds->utc-string elong
Construct a textual representation of the date passed in argument
@end deffn

@deffn {bigloo procedure} date-second date
Returns the number of seconds of a date, in the range @code{0...59}.
@end deffn

@deffn {bigloo procedure} date-minute date
Returns the minute of a date, in the range @code{0...59}.
@end deffn

@deffn {bigloo procedure} date-hour date
Returns the hour of a date, in the range @code{0...23}.
@end deffn

@deffn {bigloo procedure} date-day date
Returns the day of a date, in the range @code{1...31}.
@end deffn

@deffn {bigloo procedure} date-wday date
Returns the week day of a date, in the range @code{1...7}.
@end deffn

@deffn {bigloo procedure} date-yday date
Returns the year day of a date, in the range @code{1...366}.
@end deffn

@deffn {bigloo procedure} date-month date
Returns the month of a date, in the range @code{1...12}.
@end deffn

@deffn {bigloo procedure} date-year date
Returns the year of a date.
@end deffn

@deffn {bigloo procedure} date-timezone date
Returns the timezone of a date.
@end deffn

@deffn {bigloo procedure} date-is-dst date
Returns @code{-1} if the information is not available, @code{0} is the
date does not contain daylight saving adjustment, @code{1} if it
contains a daylight saving adjustment.
@end deffn

@deffn {bigloo procedure} +second elong1 elong2
@deffnx {bigloo procedure} *second elong1 elong2
@deffnx {bigloo procedure} -second elong1 elong2
@deffnx {bigloo procedure} =second elong1 elong2
@deffnx {bigloo procedure} >second elong1 elong2
@deffnx {bigloo procedure} >=second elong1 elong2
@deffnx {bigloo procedure} <second elong1 elong2
@deffnx {bigloo procedure} <=second elong1 elong2
Arithmetic operators on seconds.
@end deffn

@deffn {bigloo procedure} integer->second
Converts a Bigloo fixnum integer into a second number.
@end deffn

@deffn {bigloo procedure} day-seconds
Returns the number of seconds contained in one day.
@end deffn

@deffn {bigloo procedure} day-name int
@deffnx {bigloo procedure} day-aname int
Return the name and the abbreviated name of a week day.
@end deffn

@deffn {bigloo procedure} month-name int
@deffnx {bigloo procedure} month-aname int
Return the name and the abbreviated name of a month.
@end deffn

@deffn {bigloo procedure} leap-year? int
Returns @code{#t} if and only if the year @var{int} is a leap year. 
Returns @code{#f} otherwise.
@end deffn


