> >There are machines where the internal format of time is not seconds
> >since 1.1.70, ...
>
> I agree. However, very simple math can be used to make the
> conversion. However, conversion from UTCTime and GeneralizedTime is a bit
> more complicated. I do admit that operating systems provide the necessary
> routines to handle this in a few lines of code.
If you assume a systrem that uses time_t and the availablity of a gmtime
function, something like the following should work to convert a
generalizedtime in Zulu to a time_t.
time_t test = (time_t) 0; int i ;
for (i = ( sizeof(time_t)*8-2) ; i>=0; i--) {
test += (time_t)(1 << i) ;
strftime(strtime, 16, "%Y%m%d%H%M%SZ",gmtime(&test));
if (strncmp(tm->data,strtime,15) < 0)
test -= (time_t)(1 << i) ;
}
> >Showing this time to a user always requires some conversion, while
> >displaying a generaizedtime does not.
>
> Display to a human is not the biggest concern. Date comparison is a much
> bigger deal to me. Integer comparison is easy, even when multi-precision
> integers are involved.
Comparison of ordered text strings is also simple.
Dates in certificates are in generalizedtime.