From: Richard J. <ri...@an...> - 2004-10-29 14:38:32
|
On Fri, Oct 29, 2004 at 04:31:15PM +0200, Julien Signoles wrote: > With the module Date of calendar, you have: >=20 > # let business_of_standard d =3D week d, day_of_week d;; > val business_of_standard : Date.t -> int * Date.day =3D <fun> =2E.. except the difficult thing with business weeks is that business year is not necessarily equal to ordinary year. (Even PostgreSQL 7.4 gets this wrong). > # business_of_standard (make 2004 12 31);; > - : int * Date.day =3D (53, Fri) > # business_of_standard (make 2003 12 31);; > - : int * Date.day =3D (1, Wed) >=20 > In my opinion, it is the same except that my version does not return > the year. But it is possible to deduce it from the month and the week if > necessary. It's not ... or at least not trivially. Check out the implementation in GregorianDate. Rich. --=20 Richard Jones. http://www.annexia.org/ http://www.j-london.com/ >>> http://www.team-notepad.com/ - collaboration tools for teams <<< Merjis Ltd. http://www.merjis.com/ - improving website return on investment Write Apache modules in OCaml - http://www.merjis.com/developers/mod_caml |