[PYTHON-CRYPTO] Add ANS1_UTCTIME.get_datetime function

Pavel Shramov shramov at MEXMAT.NET
Tue Mar 24 13:54:42 CET 2009


OpenSSL ASN1_UTCTIME_print (and other time printing functions) produce
output not suitable for parsing with strptime:
 * Month name are not locale-dependant so python strptime fail to
   recognize them (e.g. in gtk applications)
 * Timezone is either missing or ' GMT' (with space)

Proposed patch adds get_datetime function that returns python
datetime.datetime structure with correct timezone. If this function
looks suitable I'll add tests.
                Pavel

P.S. Error messages are not perfect so they must be changed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get_datetime.patch
Type: text/x-diff
Size: 2103 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-crypto/attachments/20090324/f7b872d2/attachment.patch>


More information about the python-crypto mailing list