protocol
datep
Date protocol.
logtalk_load(dates(loader))staticPublic predicates
today/3
Returns current date.
statictoday(Year,Month,Day)today(-integer,-integer,-integer) - oneleap_year/1
True if the argument is a leap year.
staticleap_year(Year)leap_year(+integer) - zero_or_onename_of_day/3
Name and short name of day using ISO weekday numbering (Monday=1, …, Sunday=7).
staticname_of_day(Index,Name,Short)name_of_day(?integer,?atom,?atom) - zero_or_morename_of_month/3
Name and short name of month.
staticname_of_month(Index,Name,Short)name_of_month(?integer,?atom,?atom) - zero_or_moredays_in_month/3
Number of days in a month.
staticdays_in_month(Month,Year,Days)days_in_month(?integer,+integer,?integer) - zero_or_morevalid/3
True if the arguments represent a valid date.
staticvalid(Year,Month,Day)valid(@integer,@integer,@integer) - zero_or_onedate_time_to_unix/2
Converts a UTC date-time term date_time(Year,Month,Day,Hours,Minutes,Seconds) to Unix epoch seconds.
staticdate_time_to_unix(DateTime,UnixTime)date_time_to_unix(+compound,-integer) - zero_or_oneunix_to_date_time/2
Converts Unix epoch seconds to a UTC date-time term date_time(Year,Month,Day,Hours,Minutes,Seconds).
staticunix_to_date_time(UnixTime,DateTime)unix_to_date_time(+integer,-compound) - oneadd_duration/3
Adds a duration to a datetime. Duration can be integer seconds, duration(Days,Hours,Minutes,Seconds), or a calendar-aware duration(Years,Months,Days,Hours,Minutes,Seconds). For the 6-arity form, the year and month delta is applied first using calendar arithmetic, clamping the day to the last valid day of the resulting month when necessary (e.g. January 31 plus one month gives February 28 or 29), and the remaining day and time delta is then applied via fixed-length arithmetic.
staticadd_duration(DateTime,Duration,ResultDateTime)add_duration(+compound,+nonvar,-compound) - zero_or_onesubtract_duration/3
Subtracts a duration from a datetime. Duration can be integer seconds, duration(Days,Hours,Minutes,Seconds), or a calendar-aware duration(Years,Months,Days,Hours,Minutes,Seconds). For the 6-arity form, the year and month delta is subtracted first using calendar arithmetic with end-of-month day clamping, and the remaining day and time delta is then subtracted via fixed-length arithmetic.
staticsubtract_duration(DateTime,Duration,ResultDateTime)subtract_duration(+compound,+nonvar,-compound) - zero_or_oneduration_between/3
Computes the difference between two datetimes as integer seconds, as duration(Days,Hours,Minutes,Seconds), or as a calendar-aware duration(Years,Months,Days,Hours,Minutes,Seconds). For the 6-arity form, the year and month components count the largest whole number of calendar months between the two datetimes (consistent with the day-clamping semantics of add_duration/3), and the remaining days and time fields are the exact residual. For backward intervals all fields are negative.
staticduration_between(StartDateTime,EndDateTime,Duration)duration_between(+compound,+compound,?term) - zero_or_oneutc_to_local/3
Converts a UTC datetime to a local datetime using an explicit timezone offset atom (Z or ±HH:MM).
staticutc_to_local(UTCDateTime,Offset,LocalDateTime)utc_to_local(+compound,+atom,-compound) - zero_or_onelocal_to_utc/3
Converts a local datetime to UTC using an explicit timezone offset atom (Z or ±HH:MM).
staticlocal_to_utc(LocalDateTime,Offset,UTCDateTime)local_to_utc(+compound,+atom,-compound) - zero_or_oneformat_date_time/4
Formats a date-time using an explicit UTC offset in seconds. Supported format identifiers are rfc3339, iso8601, atom, rfc2822, rfc5322, rss, http_date, rfc1123, unix_date, common_log, date_short, date_medium, date_long, date_full, time_short, time_medium, time_long, time_full, date_time_short, date_time_medium, date_time_long, and date_time_full. RFC 3339, ISO 8601, Atom, and the date_* and date_time_* styles require a four-digit non-negative year. Formats that include numeric offsets require an offset expressible in whole minutes. HTTP-date and RFC 1123 output are always normalized to GMT. The style presets are English-only presentation formats. Fails if the format or date-time are not valid.
staticformat_date_time(DateTime,OffsetSeconds,Format,String)format_date_time(+compound,+integer,+atom,-atom) - zero_or_oneday_of_year/2
Computes the day of year (1-366) for a date(Year,Month,Day) or date_time(...) term.
staticday_of_year(DateLike,DayOfYear)day_of_year(+compound,?integer) - zero_or_oneday_of_year_date/3
Computes the calendar date corresponding to a year and day of year (1-366) as date(Year,Month,Day).
staticday_of_year_date(Year,DayOfYear,Date)day_of_year_date(+integer,+integer,-compound) - zero_or_onemonth_weekday_date/5
Computes the calendar date for the nth or last weekday in a month as date(Year,Month,Day). Week values 1-4 select the nth weekday and week value 5 selects the last one. Weekday uses ISO numbering (Monday=1, …, Sunday=7).
staticmonth_weekday_date(Year,Month,Week,Weekday,Date)month_weekday_date(+integer,+integer,+integer,+integer,-compound) - zero_or_oneweek_of_year_iso/2
Computes ISO week for a date(Year,Month,Day) or date_time(...) term as week(Week,Year).
staticweek_of_year_iso(DateLike,ISOWeek)week_of_year_iso(+compound,?compound) - zero_or_oneweekday/2
Computes ISO weekday number (Monday=1, …, Sunday=7) for a date(Year,Month,Day) or date_time(...) term.
staticweekday(DateLike,Weekday)weekday(+compound,?integer) - zero_or_onenormalize_date_time/2
Normalizes a datetime term by carrying overflows/underflows in date and time fields.
staticnormalize_date_time(DateTime,NormalizedDateTime)normalize_date_time(+compound,-compound) - onevalid_date_time/1
True iff a datetime term is valid in strict mode.
staticvalid_date_time(DateTime)valid_date_time(@compound) - zero_or_onebefore/2
True iff DateTime1 represents an instant strictly before DateTime2.
staticbefore(DateTime1,DateTime2)before(+compound,+compound) - zero_or_oneafter/2
True iff DateTime1 represents an instant strictly after DateTime2.
staticafter(DateTime1,DateTime2)after(+compound,+compound) - zero_or_onesame_instant/2
True iff DateTime1 and DateTime2 represent the same instant (equal Unix epoch seconds).
staticsame_instant(DateTime1,DateTime2)same_instant(+compound,+compound) - zero_or_onecompare_date_time/3
Three-way comparison of two datetime terms. Order is unified with <, =, or >. Suitable for use with sort/3.
staticcompare_date_time(Order,DateTime1,DateTime2)compare_date_time(?atom,+compound,+compound) - zero_or_oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)