From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 502A4BC69 for ; Mon, 30 Jul 2007 01:10:38 +0200 (CEST) Received: from tenhost.net (tenhost.net [64.246.28.52]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id l6TNAXLW024660 for ; Mon, 30 Jul 2007 01:10:37 +0200 Received: (qmail 27215 invoked from network); 29 Jul 2007 17:44:21 -0500 Received: from ip72-208-52-84.ph.ph.cox.net (HELO ?192.168.1.99?) (72.208.52.84) by tenhost.net with SMTP; 29 Jul 2007 17:44:21 -0500 Message-ID: <46AD1E22.6080705@ramenlabs.com> Date: Sun, 29 Jul 2007 16:09:22 -0700 From: Dave Benjamin User-Agent: Mozilla-Thunderbird 2.0.0.4 (X11/20070622) MIME-Version: 1.0 To: Richard Jones Cc: caml-list@inria.fr Subject: Re: [Caml-list] ANN: XmlRpc-Light 0.4 - Now a server too References: <46ACD395.4080609@ramenlabs.com> <20070729211615.GA25630@furbychan.cocan.org> In-Reply-To: <20070729211615.GA25630@furbychan.cocan.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46AD1E69.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lri:01 signoles:01 parser:01 subset:01 ocamlnet:01 pcre:01 ocaml:01 cheers:01 0.4:98 wrote:01 wrote:01 encode:01 caml-list:01 functions:01 dependency:01 Richard Jones wrote: > On Sun, Jul 29, 2007 at 10:51:17AM -0700, Dave Benjamin wrote: >> - The default date-time functions use the format >> "20070729T10:42:00-07:00". This seems to be the most common >> interpretation of ISO 8601 used in XML-RPC servers. You can override >> this behavior by calling the "set_datetime_encode" or >> "set_datetime_decode" methods on the client or server. > > You might want to take a look at Julien Signoles' Calendar library for > date/time types and handling: > > http://www.lri.fr/~signoles/prog/calendar/ I have this library installed, and indeed considered using it when I began writing the date-time support. I would likely have used it, if only it had the ability to parse strings. I really wish Winer had considered alternatives to ISO 8601--say, UTC epoch seconds--in the design of XML-RPC, because it's barely a standard at all! There are so many variations and options that writing a parser for it borders on natural language processing. Even the W3C suggestion, which restricts ISO 8601 to a very small subset, doesn't help here since it still conflicts with the common usage in XML-RPC, with hyphens omitted between the date values. I decided to err on the side of oversimplification, and support only the most common format, leaving in hooks for users to customize the behavior as required. There is still benefit, of course, in using a standard date-time type. I only wonder if it is worth adding another library dependency; I am trying hard to keep the list small (currently only Xml-Light and Ocamlnet, which in turn requires PCRE). I think it would be great if a date-time type were made part of the official OCaml distribution. My only qualm with the Calendar library is that I feel a bit uncomfortable with a top-level module called "Printer" that is for the specific purpose of date formatting. I would assume that a module by that name were for communicating with "lpt", if anything. But hey, what's in a name, anyway... =) Thanks for the advice. I will consider it. Cheers, Dave