
date.pl -- Process dates and times
date_time_value(?Field:atom, +Struct:datime, -Value) is nondet
- Extract values from a date-time structure. Provided fields are
year integer month 1..12 day 1..31 hour 0..23 minute 0..59 second 0.0..60.0 utc_offset integer Offset to UTC in seconds (positive is west) daylight_saving bool Name of timezone; fails if unknown date date(Y,M,D)
time time(H,M,S)
parse_time(+Text, -Stamp) is semidet
parse_time(+Text, ?Format, -Stamp) is semidet
- Stamp is a timestamp created from parsing Text using the
representation Format. Currently supported formats are:
- rfc_1123
- Preferred for the HTTP protocol to represent time-stamps, e.g.
Fri, 08 Dec 2006 15:29:44 GMT
All components except for the time zone are obligatory. If the time zone is omitted, the time is interpreted as local time.
- rfc_1036
- (Outdated) alternative for HTTP Protocol, e.g.
Sunday, 06-Nov-94 08:49:37 GMT
- iso_8601
- Commonly used in XML documents. Actually the XML RFC3339
is a profile of ISO8601. For example
2006-12-08T15:29:44Z
The ISO8601 format allows removing components from the right, returning the lowest time stamp in the specified internal. If a time is specified but no time zone, the time stamp is computed for the local time. If only the date components are specified, the stamp uses UTC. To compute the start of a day in local time, use e.g.
2006-12-08T00
. - asctime
- ANSI C's
asctime()
format, e.g.Sun Nov 6 08:49:37 1994
This format has no time zone and is interpreted as local time.
day_of_the_week(+Date, -DayOfTheWeek) is det
- Computes the day of the week for a given date. Days of the week are numbered from one to seven: monday = 1, tuesday = 2, ..., sunday = 7.
day_of_the_year(+Date, -DayOfTheYear) is det
- Computes the day of the year for a given date. Days of the year are numbered from 1 to 365 (366 for a leap year).
Re-exported predicates
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
parse_time(+Text, -Stamp) is semidet
parse_time(+Text, ?Format, -Stamp) is semidet
- Stamp is a timestamp created from parsing Text using the
representation Format. Currently supported formats are:
- rfc_1123
- Preferred for the HTTP protocol to represent time-stamps, e.g.
Fri, 08 Dec 2006 15:29:44 GMT
All components except for the time zone are obligatory. If the time zone is omitted, the time is interpreted as local time.
- rfc_1036
- (Outdated) alternative for HTTP Protocol, e.g.
Sunday, 06-Nov-94 08:49:37 GMT
- iso_8601
- Commonly used in XML documents. Actually the XML RFC3339
is a profile of ISO8601. For example
2006-12-08T15:29:44Z
The ISO8601 format allows removing components from the right, returning the lowest time stamp in the specified internal. If a time is specified but no time zone, the time stamp is computed for the local time. If only the date components are specified, the stamp uses UTC. To compute the start of a day in local time, use e.g.
2006-12-08T00
. - asctime
- ANSI C's
asctime()
format, e.g.Sun Nov 6 08:49:37 1994
This format has no time zone and is interpreted as local time.