Cook Computing

dateTime in XML-RPC

May 15, 2002 Written by Charles Cook

Some more postings on dateTime on the xml-rpc list. Although referenced by Adam Megacz' XMC spec, the XML-RPC dateTime format is not one of the formats in the W3C document on Date and Time Formats. I've not studied the ISO Standard but a posting on the from Graham Dumpleton lists says:

I have actually made one mistake here. The ISO 8601 basic format for date/time is CCYYMMDDThhmmss and is not CCYYMMDDThh:mm:ss. Ignoring the case difference, the important thing is that in the basic format you aren't supposed to use ":" to seperate the time of day components as is being done in the XML-RPC specification.

That is, the XML-RPC specification isn't using either the basic or extended formats for date/time but a conglomeration of both. A quick glance of the ISO 8601 standard isn't real clear as to whether you are allowed to do this and perhaps there basic and extended formats are just examples, the important thing simply being the seperators "-" and ":" are used when required and use of one doesn't imply that the other has to be used as long as the intent is clearly distinguishable.

One can only assume that one has not choice but to use the format CCYYMMDDThh:mm:ss. The reason is that people implementing XML-RPC clients and servers may not even realise that ISO 8601 allows other formats and only implement the example in the specification. One PHP implementation for example only implements the example in the XML-RPC specification.

It would be less confusing if any references for dateTime were dropped and the format simply stated to be YYYYMMDDTHH:mm:SS. Programming Web Services with XML-RPC also states the format is YYYYMMDDTHH:mm:SS. I suspect that there may be several implementations which assume this format and which don't support any other variant - I know of at least one ;-)