object
ISO 8601 (and European civil calendar) compliant library of date predicates.
Daniel L. Dudley
1.02
2014/11/3
static, context_switching_calls
(no dependencies on other files)
Get the system date and/or its Julian Day # or convert a Julian Day # to/from given date parts.
static
date(JD,Year,Month,Day)
JD
– Julian day serial numberYear
– 0 or negative if converted BC year, positive otherwiseMonth
– Normally an integer between 1 and 12 inclusiveDay
– Normally an integer between 1 and 31 inclusive depending upon monthdate(?integer,?integer,?integer,?integer) – zero_or_one
Ditto date/4 + get/check its day-of-week #.
static
date(JD,Year,Month,Day,DoW)
JD
– Julian day serial numberYear
– 0 or negative if converted BC year, positive otherwiseMonth
– Normally an integer between 1 and 12 inclusiveDay
– Normally an integer between 1 and 31 inclusive depending upon monthDoW
– Day of week, where Monday=1, Tuesday=2, ..., Sunday=7date(?integer,?integer,?integer,?integer,?integer) – zero_or_one
Ditto date/5 + get/check its week #.
static
date(JD,Year,Month,Day,DoW,Week)
JD
– Julian day serial numberYear
– 0 or negative if converted BC year, positive otherwiseMonth
– Normally an integer between 1 and 12 inclusiveDay
– Normally an integer between 1 and 31 inclusive depending upon monthDoW
– Day of week, where Monday=1, Tuesday=2, ..., Sunday=7Week
– Compound term, week(WeekNo,ActualYear), of a daydate(?integer,?integer,?integer,?integer,?integer,?compound) – zero_or_one
Ditto date/6 + get/check its day-of-year #.
static
date(JD,Year,Month,Day,DoW,Week,DoY)
JD
– Julian day serial numberYear
– 0 or negative if converted BC year, positive otherwiseMonth
– Normally an integer between 1 and 12 inclusiveDay
– Normally an integer between 1 and 31 inclusive depending upon monthDoW
– Day of week, where Monday=1, Tuesday=2, ..., Sunday=7Week
– Compound term, week(WeekNo,ActualYear), of a dayDoY
– Day of year (NB! calendar year, not week # year)date(?integer,?integer,?integer,?integer,?integer,?compound,?integer) – zero_or_one
Conversion between an ISO 8601 compliant date string and its components (truncated and expanded date representations are currently unsupported). Note that date components are not validated; that is the caller's responsibility!
static
date_string(Format,Components,String)
Format
– ISO 8601 formatComponents
– When bound and String is free, either a Julian number or a [Year,Month,Day] term; it binds to the system day/date if free When free and String is bound, it binds to an integer list representing the numeric elements of StringString
– ISO 8601 formatted string correspondent to Componentsdate_string(+atom,+integer,?atom) – zero_or_one
date_string(+atom,?list,?atom) – zero_or_one
Validate a given date in the Gregorian calendar.
static
valid_date(Year,Month,Day)
valid_date(+integer,+integer,+integer) – zero_or_one
Succeed if given year is a leap year in the Gregorian calendar.
static
leap_year(Year)
Year
– The Gregorian calendar year to investigate. If free, it binds to the system yearleap_year(?integer) – zero_or_one
Compute a calendar month.
static
calendar_month(Year,Month,Calendar)
Year
– The calendar yearMonth
– The calendar monthCalendar
– A compound term, m/3, composed of three main arguments specifying year, month, and a list of week and week day numbers (calendar body).calendar_month(?integer,?integer,-compound) – zero_or_one
Compute a Gregorian Easter Sunday.
static
easter_day(Year,Month,Day)
Year
– Integer specifying the year to be investigatedMonth
– Month in which Easter Sunday falls for given yearDay
– Day of month in which Easter Sunday falls for given yeareaster_day(?integer,-integer,-integer) – zero_or_one
(none)
(none)