libkeepass / pykeepass

Python library to interact with keepass databases (supports KDBX3 and KDBX4)
https://pypi.org/project/pykeepass/
GNU General Public License v3.0
403 stars 96 forks source link

Use built-in isoformat support #383

Closed City-busz closed 4 months ago

City-busz commented 4 months ago

The ISO formatted string can be stored in multiple formats. Use the built-in datetime.isoformat() and datetime.fromisoformat() functions, which able to handle all variants.

Fixes: https://github.com/libkeepass/pykeepass/issues/382

Evidlo commented 4 months ago

Thanks for investigating this.

.fromisoformat on Python 3.6-3.10 does not support the 'Z' suffix to indicate timezone, so we need an additional .replace('Z', '+00:00') as mentioned in this thread

City-busz commented 4 months ago

Okay, I updated the MR to include this replace for compatibility.