Appendix E
The datetime Module
Picat’s datetime module provides built-ins for retrieving the date and time. This module must be imported before use.
-
current_datetime() = : This function returns the current date and time as a structure in the form
date_time(, , , , , )
where the arguments are all integers, and have the following meanings and ranges.
Argument Meaning Range years since 1900 an integer months since January 0-11 day of the month 1-31 hours since midnight 0-23 minutes after the hour 0-59 seconds after the minute 0-60 In the argument, represents January, and represents December. In the argument, represents AM, and represents PM. In the argument, the value represents a leap second.
- current_date() = : This function returns the current date as a structure in the form date(, , ), where the arguments have the meanings and ranges that are defined above.
- current_day() = : This function returns the number of days since Sunday, in the range 0 to 6.
- current_time() = : This function returns the current time as a structure in the form time(, , ), where the arguments have the meanings and ranges that are defined above.