Optional microseconds in Python Eve DATE_FORMAT setting

52 views Asked by At

Within my eve_settings (Python Eve) I have this line for global date format.

'DATE_FORMAT': '%Y-%m-%dT%H:%M:%SZ'

However, I would like flexibility to be able to permit microseconds without needing to introduce a custom data type. The following would permit microseconds, but then does not appear to permit timestamps without the microseconds.

'DATE_FORMAT': '%Y-%m-%dT%H:%M:%S.%fZ'

I did try using '%Y-%m-%dT%H:%M:%S(.%f)Z' and '%Y-%m-%dT%H:%M:%S[.%f]Z' but they do not appear to be accepted.

Is it possible to have both formats within the DATE_FORMAT setting?

0

There are 0 answers