From: Jesse G. <je...@wi...> - 2004-08-11 04:42:42
|
Jesse Guardiani wrote: > Nicolas Cannasse wrote: > >>> On Fri, Aug 06, 2004 at 08:32:53AM -0700, Blair Zajac wrote: >>> > Richard Jones wrote: >>> > >Perl has a very extensive module with date support: >>> > >http://search.cpan.org/dist/Date-Calc/Calc.pod >>> > >>> > As an FYI, many of the Perl people got fed up with all the different >> date >>> > time modules and started a new set of modules to provide the same >>> > functionality, but hopefully learning from experience. >>> > >>> > http://datetime.perl.org/ >>> >>> There seem to be some problems with the Datetime concept and OCaml. >>> The main problem I can see is the fact that Datetime is fundamentally >>> object oriented. I'd prefer to see a solution where dates are >>> represented (ideally) by tuples or by structures, because this allows >>> simple pattern matching. However, I understand that the complexity >>> behind a general datetime type may make this difficult to achieve. >>> >>> FWIW, GregorianDate (derived from Date::Calc) is relatively simple and >>> self-contained. It represents dates as tuples of either (year, month, >>> day) or (year, week) (for ISO 8601 business dates). It doesn't depend >>> on any existing representations, nor would anything depend on it. It >>> clearly (from the name) only deals with the Gregorian calendar. So >>> I'd like to propose it as a "good enough" candidate for ExtLib, >>> because it's independent and can even be deprecated later without >>> affecting anything but the direct users of that one module. See >>> attached the .mli with documentation. >>> >>> Rich. >> >> I think that a DateTime module would be more useful than only dates. >> We could represent as a Unix.tm structure or as a float returned by >> Unix.time() , and provide some printing and extracting facilities. > > I agree. And I vote for the float from Unix.time(). I think then all > we need is a formatting function that works like the UNIX date program > (printf style formatting). Does anyone know enough about how printf > works to tackle such a function? Actually, if all we're doing is returning a string, this function wouldn't require any of the normal Printf tricks. One string argument input, and one string output. -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net |