Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] date manipulation library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stefano Zacchiroli <zack@b...>
Subject: Re: [Caml-list] date manipulation library
On Mon, Sep 15, 2003 at 05:22:49PM +0200, Julien Signoles wrote:
> My calendar library, available at
>, allows such a thing. For
> example:

Really interesting, thanks for this contribution!
I'm working on schema implementation and this library turns out to be
really handy wrt date/time/periods comparison.

I'm interested in releasing a debian package of it, if it's ok for you.

I've also some comments on the library, I will be happy to know your
position on them:

1) why the timezone setting is global? It's really a non functional
   approach and it turns out to be very annoying.
   I would rather prefer to have an optional timezone attached to both
   time and dates. This could be reflected in an optional parameter of
   date/time constructors and in destructors to fetch timezones raising
   exceptions when it's undefined.

2) often user defined pretty printing is needed for time/dates. What
   about adding more pretty printing functions in addition to the
   already provided to_string? Implementing a generic pretty printing
   format which use the "date" unix command format will be fantastic for
   unix gurus. Just to start a generic destructor function will be

I'm willing to help working on this changes if you like.

Minor observations:

- the library isn't on the humps, am I wrong?

- there's a wonderful typo (look at the day) :-))))

        (* Return [true] if a date is a leap day
         (i.e. February, 24th of a leap year); [false] otherwise. *)
      val is_leap_day : t -> bool

Thanks for the library, this is the tipical piece of code that thousands
of people keep on reinventing!


P.S. what about ocamldefun? :-)

Stefano Zacchiroli  --  Master in Computer Science @ Uni. Bologna, Italy
zack@{,,}  -
"  I know you believe you understood what you think I said, but I am not
sure you realize that what you heard is not what I meant!  " -- G.Romney

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: