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 Tue, Sep 16, 2003 at 01:27:52AM +0200, Julien Signoles wrote:
> > 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.
> Yes, it is an imperative approach. I think you mostly set the time zone
> once at the beginning of your program: you don't change the time zone
> while you're computing some values. Sometimes, you may want to convert a
> time from a time zone to another one and I produce some converters to do
> that. So, my philosophy is:
> (1) set the time zone globaly: easier use of times and dates
> (an optional parameter is ok... if the default value is as you wish ;).
> (2) change the time zone localy if you need (use the converters).

This approach implicitely assume that most of the time you're dealing
with dates/times which are relativa to a common timezone and that
sparingly you have to convert from a timezone to another. What if most
of the time you're dealing with non-homogeneous timezone date/times?
Many applications have such a requirement.

If you want to keep it imperative at least a functor that permits to
preserve different timezone states would be great. It's still worst than
timezone associated to date/times IMHO.

> The justification comes from the calendar FAQ
> (

Sorry, thanks for the link!


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: