A struct tm is only granular down to whole seconds, right? Charles
-----Original Message----- From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] On Behalf Of Dr. Stephen Henson Sent: Wednesday, November 07, 2012 9:33 AM To: openssl-users@openssl.org Subject: Re: Find the difference in (milli|micro)seconds between two ASN1_TIME values On Wed, Nov 07, 2012, Graham Leggett wrote: > Hi all, > > I would like to know how long a CRL has until it expires in seconds (or milli or microseconds, don't care, I can convert), and am struggling to find a formally supported way to do this. > > What I would like to do is return the difference between a given ASN1_TIME and the current time, or two ASN1_TIME values (don't care which, I can generate an ASN1_TIME from the current time). > > Does openssl offer a function to do this, or will I be forced to write my own? > There isn't currently a function to do this but there is a commented out (and largely untested) function in crypto/asn1/a_time.c to convert an ASN1_TIME structure to a struct tm and a function to diff two tm structures called OPENSSL_gmtime_diff. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org