Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date, time and datetime should be represented as in ISO8601 #130

Open
turicas opened this issue Apr 6, 2014 · 0 comments
Open

Date, time and datetime should be represented as in ISO8601 #130

turicas opened this issue Apr 6, 2014 · 0 comments

Comments

@turicas
Copy link

turicas commented Apr 6, 2014

The ISO8601 specification requires a T between date and time (<date>T<time>), not a space (as currently implemented by flask_peewee).

Would be nice to explicitly specify the timezone also - if it's UTC, you just need to add a Z at the end.

Following this specification, a datetime that was converted to 2012-03-13 02:49:32 now would be 2012-03-13T02:49:32Z.

You can use datetime.datetime.isoformat method to serialize it accordingly. The packages iso8601 and python-dateutil may help in deserialization, if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant