Ulrich Zehl asked:
I need to parse date and time values that are encoded in the LDAP
Generalized Time syntax. According to RFC 4517, Section 3.3.13, this 
syntax
is "a restriction of the format defined in [ISO 8601:2004]". 

Following the syntax rules, a sample date and time may be encoded as
20070502074805Z (Note the lack of 'T' to seperate date and time.)

Parsing this sample date and time with DateTime::Format::ISO8601 (version 
0.06) using parse_datetime() fails, giving the following error message:
  Invalid date format: 20070502074805Z at test.pl line 499

Since I don't have access to the ISO standard, I cannot verify that the
format as given in RFC 4517 is really standards compliant, but
http://hydracen.com/dx/iso8601.htm, Section "Comined Date/Time Formats",
seems to indicate it is.

Given all this, I'd now like to know whether this format will be supported
by some future version of DateTime::Format::ISO8601, or if I should
contribute a seperate module to handle LDAP's Generalized Time syntax
(which would be easy, since I have already have a prototype that 
satiesfies
my own requirements).


To which I respond:

I have a copy of ISO 8601-2004, and I don't see where it standardizes the 
LDAP notation, though section 3.7 "Mutual Agreement" certainly would 
permit it between parties that mutually agree.  The T for separating the 
date from the time seems to be required by the standard - you can miss out 
the other punctuation, but not that one.  (I note in passing that the SQL 
standard uses a variation of ISO 8601 notation with a space in place of 
the T, but requiring full punctuation too.)  The rest of the LDAP 
Generalized Syntax as illustrated is conformant.  The ISO 8601-2004 (3rd 
Edn) standard supports sub-second times, incidentally; the original 1988 
(1st Edn) standard did not; AFAIK, the 2000 standard did not support 
sub-second times either, but I only have a draft of that so I can't be 
sure.

I can't answer for the developers of DateTime::Format::ISO8601, but it is 
not clear that they are required to support the notation, though I suspect 
it would not be hard to do so, possibly by some specialized sub-class 
(Date::Format::LDAP?) that exploits the majority of the ISO8601 code but 
permits the LDAP Generalized Time notation.

-- 
Jonathan Leffler ([EMAIL PROTECTED])
STSM, Informix Database Engineering, IBM Information Management Division
4100 Bohannon Drive, Menlo Park, CA 94025-1013
Tel: +1 650-926-6921    Tie-Line: 630-6921
"I don't suffer from insanity; I enjoy every minute of it!"

Reply via email to