Append "Z" to DATETIME_FORMAT

We're formally using the ISO 8601 UTC datetime format, and so the
correct way to output the data is by appending the timezone.
("Z" in the case of UTC*).

Unfortunately, Python's `datetime` formatting will just ignore the
timezone part of the string on output, which means we just have to
append the string "Z" to the end of all datetime strings we output.

Should be fine, as we will only ever output UTC timestamps anyway.

* https://en.wikipedia.org/wiki/ISO_8601#UTC
This commit is contained in:
Paul Craig
2016-11-21 15:16:21 +00:00
parent 82ba2cd226
commit c1fa5e156a
5 changed files with 13 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ from app.clients.statsd.statsd_client import StatsdClient
from app.encryption import Encryption
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f"
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
DATE_FORMAT = "%Y-%m-%d"
db = SQLAlchemy()