Contents Up Previous Next

Date

A class for manipulating dates.

date-add-months
date-add-weeks
date-add-years
date-create
date-create-julian
date-create-string
date-delete
date-format
date-get-day
date-get-day-of-week
date-get-day-of-week-name
date-get-day-of-year
date-get-days-in-month
date-get-first-day-of-month
date-get-julian-date
date-get-month
date-get-month-end
date-get-month-name
date-get-month-start
date-get-week-of-month
date-get-week-of-year
date-get-year
date-get-year-end
date-get-year-start
date-is-leap-year
date-set-current-date
date-set-julian
date-set-date
date-set-format
date-set-option
date-add-days
date-subtract-days
date-subtract
date-add-self
date-subtract-self
date-le
date-leq
date-ge
date-geq
date-eq
date-neq


date-add-months

long ( date-add-months long date long months)

Adds the given number of months to the date, returning 1 if successful.


date-add-weeks

long ( date-add-weeks long date long weeks)

Adds the given number of weeks to the date, returning 1 if successful.


date-add-years

long ( date-add-years long date long years)

Adds the given number of months to the date, returning 1 if successful.


date-create

long ( date-create)

Constructs a date object, initialized to zero. You are responsible for deleting this object when you have finished with it.

long ( date-create long month long day long year)

Constructs a date object with the specified date. You are responsible for deleting this object when you have finished with it.

month is a number from 1 to 12.

day is a number from 1 to 31.

year is a year, such as 1995, 2005.


date-create-julian

long ( date-create-julian long julian)

Constructor taking an integer representing the Julian date.


date-create-string

long ( date-create-string string date)

Constructor taking a string representing a date. This must be either the string TODAY, or of the form MM/DD/YYYY or MM-DD-YYYY. For example:

    (bind ?date (date-create-string "11/26/1966"))

date-delete

long ( date-delete long date)

Deletes the date object.


date-format

string ( date-format long date)

Formats the date into a string according to the current display type.


date-get-day

long ( date-get-day long date)

Returns the numeric day (in the range 1 to 365).


date-get-day-of-week

long ( date-get-day-of-week long date)

Returns the integer day of the week (in the range 1 to 7).


date-get-day-of-week-name

string ( get-day-of-week-name long date)

Returns the name of the day of week.


date-get-day-of-year

long ( date-get-day-of-year long date)

Returns the day of the year (from 1 to 365).


date-get-days-in-month

long ( date-get-days-in-month long date)

Returns the number of days in the month (in the range 1 to 31).


date-get-first-day-of-month

long ( date-get-first-day-of-month long date)

Returns the day of week that is first in the month (in the range 1 to 7).


date-get-julian-date

long ( date-get-julian-date long date)

Returns the Julian date.


date-get-month

long ( date-get-month long date)

Returns the month number (in the range 1 to 12).


date-get-month-end

long ( date-get-month-end long date)

Returns a new date representing the day that is last in the month. The new date must be deleted when it is finished with.


date-get-month-name

string ( date-get-month-name long date)

Returns the name of the month.


date-get-month-start

long ( date-get-month-start long date)

Returns a new date representing the first day of the month. The new date must be deleted when it is finished with.


date-get-week-of-month

long ( date-get-week-of-month long date)

Returns the week of month (in the range 1 to 6).


date-get-week-of-year

long ( date-get-week-of-year long date)

Returns the week of year (in the range 1 to 52).


date-get-year

long ( date-get-year long date)

Returns the year as an integer (such as '1995').


date-get-year-end

long ( date-get-year-end long date)

Returns a new date the date representing the last day of the year. Delete the new date when you have finished with it.


date-get-year-start

long ( date-get-year-start long date)

Returns a new date the date representing the first day of the year. Delete the new date when you have finished with it.


date-is-leap-year

long ( date-is-leap-year long date)

Returns 1 if the year of this date is a leap year.


date-set-current-date

long ( date-set-current-date long date)

Sets the date to current system date.


date-set-julian

long ( date-set-julian long date long julian)

Sets the date to the given Julian date.


date-set-date

long ( date-set-date long date long month long day long year)

Sets the date to the given date.

month is a number from 1 to 12.

day is a number from 1 to 31.

year is a year, such as 1995, 2005.


date-set-format

long ( date-set-format long date string format)

Sets the current format type.

format should be one of:

wxDAY Format day only.
wxMONTH Format month only.
wxMDY Format MONTH, DAY, YEAR.
wxFULL Format day, month and year in US style: DAYOFWEEK, MONTH, DAY, YEAR.
wxEUROPEAN Format day, month and year in European style: DAY, MONTH, YEAR.


date-set-option

long ( date-set-option long date string option long enable=1)

Enables or disables an option for formatting. option may be one of:

wxNO_CENTURY The century is not formatted.
wxDATE_ABBR Month and day names are abbreviated to 3 characters when formatting.


date-add-days

long ( date-add-days long date long days)

Adds an integer number of days to the date, returning a new date object.


date-subtract-days

long ( date-subtract-days long date long days)

Subtracts an integer number of days from the date, returning a new date object.


date-subtract

long ( date-subtract long date long date1 long date2)

Subtracts one date from another, return the number of intervening days.


date-add-self

long ( date-add-self long date long days)

Adds an integer number of days to the date, returning 1 if successful.


date-subtract-self

long ( date-subtract-self long date long days)

Subtracts an integer number of days from the date, returning 1 if successful.


date-le

long ( date-le long date1 long date2)

Function to compare two dates, returning 1 if date1 is earlier than date2.


date-leq

long ( date-leq long date1 long date2)

Function to compare two dates, returning 1 if date1 is earlier than or equal to date2.


date-ge

long ( date-ge long date1 long date2)

Function to compare two dates, returning 1 if date1 is later than date2.


date-geq

long ( date-geq long date1 long date2)

Function to compare two dates, returning 1 if date1 is later than or equal to date2.


date-eq

long ( date-eq long date1 long date2)

Function to compare two dates, returning 1 if date1 is equal to date2.


date-neq

long ( date-neq long date1 long date2)

Function to compare two dates, returning 1 if date1 is not equal to date2.