I tried creating a "basic" datetime object to serialize and deserialize in omf v1.0.1 (see example below). The object is written to disk without issue however upon deserialization I get a ValueError (ValueError: time data '1-01-01T00:00:00Z' does not match format '%Y-%m-%dT%H:%M:%SZ')
Looking at the technical details here it looks like in some cases only years > 1000 should / could be accepted. I agree the %Y should be zero padding according to the docs but it doesn't look like it. This does look like a datetime bug? but maybe omf could / should be handling this?
eg. This does not work but probably should?
value = datetime.strftime(datetime(1,1,1), '%Y-%m-%dT%H:%M:%SZ')
datetime.strptime(value, '%Y-%m-%dT%H:%M:%SZ')
My question are:
Should this be somehow caught in validation steps and not allowed?
Should / could the 0 padding be better enforced? (eg. something like: value = '000' + value in DateTime.to_json
I tried creating a "basic" datetime object to serialize and deserialize in omf v1.0.1 (see example below). The object is written to disk without issue however upon deserialization I get a ValueError (
ValueError: time data '1-01-01T00:00:00Z' does not match format '%Y-%m-%dT%H:%M:%SZ'
)Looking at the technical details here it looks like in some cases only years > 1000 should / could be accepted. I agree the %Y should be zero padding according to the docs but it doesn't look like it. This does look like a datetime bug? but maybe omf could / should be handling this?
eg. This does not work but probably should?
My question are:
value = '000' + value
inDateTime.to_json
OS: Pop-os! (Ubuntu 22.02 derived) Python: 3.10 omf: 1.0.1