[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: attributetype 'date' syntax



> On Mon, May 19, 2003 at 06:28:56PM +0200, Pierangelo Masarati wrote:
>>
>> > Ron Peterson writes:
>> >> Is there a common syntax for defining a 'date' type attribute?
>> >
>> > Generalized Time, OID 1.3.6.1.4.1.1466.115.121.1.24.
>> >
>> > Format: yyyymmddHHMMSSzone,
>> >   where zone is "Z" which means Coordinated Universal Time
>> (equivalent
>> > to Greenwich Mean Time), or "-HHMM", or "+HHMM".
>> >
>> > Actually the minute and second components are optional, and you can
>> also have a fraction of a second, but I'm not sure if OpenLDAP
>> supports the full syntax.
>>
>> As far as I remember, OpenLDAP does not admit optional values,
>> e.g. everything is required.  You can find helper routines to
>> generate generalized time in libraries/liblutil/utils.c, and
>> of course the corresponding validation/normalization code in
>> servers/slapd/schema_init.c; if not present, we could modify
>> validation/normalization routines to accept formats with missing
>> optional portions...
>
> Thanks guys.  I want to create a 'birthday' attribute type.  For now, I
> think I'll just zero all the non-date portions of the generalized time
> structure.  The 'check_time_syntax' function in schema_init.c seems to
> be the place to loosen the validation restrictions.  I might do that
> later, but at the moment it would be a distraction...

Apparently, ASN.1 states that generalized time MUST have minutes
and seconds, even if they're zero.  In any case, you shouldn't
muck with server side code other than to fix bugs.  Otherwise
you'll lose interoperability, and have to port your changes
everytime you upgrade.

p.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it