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

ISO datatime format #91

Open
jmpmcmanus opened this issue Nov 26, 2019 · 2 comments
Open

ISO datatime format #91

jmpmcmanus opened this issue Nov 26, 2019 · 2 comments

Comments

@jmpmcmanus
Copy link

I am trying to query datetime, but have not been able to get it to work using iso datetime format:

api/meas/?timestamp__lte=2019-06-20T15:20:30&timestamp__gte=2019-05-12T15:20:30

Will return no data.

However, it will work if I take the T out:

api/meas/?timestamp__lte=2019-06-20 15:20:30&timestamp__gte=2019-05-12 15:20:30

which will convert it to:

api/meas/?timestamp__lte=2019-06-20%2015:20:30&timestamp__gte=2019-05-12%2015:20:30

It returns the expected data.

Is there a setting, to enable it to use iso datetime format?

Thanks
Jim

@jasonboukheir
Copy link

Running into the same issue here

@miki725
Copy link
Owner

miki725 commented Dec 30, 2019

when using Django ORM, form field to validate the value is generated by the model field itself -

form_field = field.formfield()

for date fields, that will usually be a DateField or DateTimeField which by default honors DATE_INPUT_FORMATS or DATETIME_INPUT_FORMATS and those do not support utc by default. you can add iso format there to add iso support

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

3 participants