Is there a library for Prolog that does common date manipulations?
I.e.,
- add 30 days to the current date.
- calculate number of days between dates
etc.
Various Prolog implementations have such a library, but AFAIK, there is no
standard. Some are pure Prolog, so you should be able to port them if the
license allows. The SWI-Prolog one is based on `libtai', a C library for time
manipulation.
Cheers --- Jan
Logtalk includes an ISO 8601 library contributed by Daniel L. Dudley.
Cheers,
Paulo
Sorry, forgot the link to the library documentation:
http://logtalk.org/contributions/iso8601_0.html
Cheers,
Paulo
There is no ready to use library. See the paper
Representing calendrical algorithms and data in Prolog and Prolog III
languages
ACM SIGPLAN Notices archive
Volume 30 , Issue 7 (July 1995)
Pages: 45 - 51
Year of Publication: 1995
http://portal.acm.org/citation.cfm?id=208644
A.L.
ECLiPSe's calendar library allows you to do this. Looking at the code,
it appears to be written in ECLiPSe source, so it should be possible to
port most of it to other Prologs.
--Kish
No, I don't know if there is a standard library. We implemented our
own datime library in Prolog for Etalis ( http://code.google.com/p/etalis/
) for some tasks: compare datimes, add a duration in seconds to the a
datime, etc (it is in utlis.P in the SVN repository).
Paul.