WebOfTrust / keripy

Key Event Receipt Infrastructure - the spec and implementation of the KERI protocol
https://keripy.readthedocs.io/en/latest/
Apache License 2.0
60 stars 55 forks source link

Fix notes datetime ISO 8601 format #827

Closed rodolfomiranda closed 3 months ago

rodolfomiranda commented 4 months ago

Notes that are not initiated with a dt parameter, are being created with a default dt that don't follows the ISO 8601 format. The class use the function datetime.datetime.now().isoformat() to create the string timestamp that result in a value without timezone or offset such as 2023-10-05T14:48:23.123456. Instead, keripy normal use helping.nowIso8601() to create the timestamp that result in values like 2021-06-27T21:26:21.233257+00:00

m00sey commented 3 months ago

Any interest in fixing the other usages of datetime vs helping.nowISO() @rodolfomiranda 😬

rodolfomiranda commented 3 months ago

Any interest in fixing the other usages of datetime vs helping.nowISO()

I could only find datetime.datetime used in signaling.py. I updated it. The rest of keripy seems to be ok since datetime is only used for timedelta.

m00sey commented 3 months ago

Any interest in fixing the other usages of datetime vs helping.nowISO()

I could only find datetime.datetime used in signaling.py. I updated it. The rest of keripy seems to be ok since datetime is only used for timedelta.

Thanks, appreciate you taking the extra time.

pfeairheller commented 3 months ago

Can we please explain in the description of the PR why this change is being made? The helping functions are used in many other places in KERIpy, specifically for time in KERI events and credentials. Why are you proposing we change them for only this small subset of date usages?

If the date functions are wrong, why not fix them?

rodolfomiranda commented 3 months ago

If the date functions are wrong, why not fix them?

date functions are correct, but were not applied correctly in a couple of lines in notifying.py and signaling.py

SmithSamuelM commented 3 months ago

Should be using helping.nowIso8601() or helping.toIso8601 everywhere there is a datetime string (non CESR encoded). Or Dater instance if want CESR encoded datetime