oasis-open / cti-python-stix2

OASIS TC Open Repository: Python APIs for STIX 2
https://stix2.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
356 stars 113 forks source link

fix: Ensure year is always 4 digits #570

Open Darkheir opened 11 months ago

Darkheir commented 11 months ago

Because of this issue in CPython on some platform the dates having a year smaller than 1000 will be on less than 4 digits.

format_datetime(datetime(200, 1, 1)) # 200-01-01T00:00:00Z

This PR make sure that the year is always formatted with 4 digits:

format_datetime(datetime(200, 1, 1)) # 0200-01-01T00:00:00Z
CLAassistant commented 11 months ago

CLA assistant check
All committers have signed the CLA.