Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

date/time math

2 views
Skip to first unread message

metaperl.com

unread,
Dec 1, 2009, 1:24:27 AM12/1/09
to
Hello,

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.

Jan Wielemaker

unread,
Dec 1, 2009, 3:22:25 AM12/1/09
to

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

Paulo Moura

unread,
Dec 1, 2009, 7:03:59 AM12/1/09
to

Logtalk includes an ISO 8601 library contributed by Daniel L. Dudley.

Cheers,

Paulo

Paulo Moura

unread,
Dec 1, 2009, 7:05:31 AM12/1/09
to

Sorry, forgot the link to the library documentation:

http://logtalk.org/contributions/iso8601_0.html

Cheers,

Paulo


A.L.

unread,
Dec 1, 2009, 9:11:04 AM12/1/09
to

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.

Kish Shen

unread,
Dec 1, 2009, 4:00:29 PM12/1/09
to

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

fodor

unread,
Dec 2, 2009, 11:10:08 PM12/2/09
to

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.

0 new messages