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

error when deserializing datetimefield #26

Open
rmartins90 opened this issue Oct 11, 2015 · 2 comments
Open

error when deserializing datetimefield #26

rmartins90 opened this issue Oct 11, 2015 · 2 comments

Comments

@rmartins90
Copy link

# datetime
typ = field.get_internal_type()
if val and typ in ('DateField', 'DateTimeField'):
    return datetime.datetime.strptime(val, '%Y-%m-%dT%H:%M:%S.%f') 

This code block raises the following error:

ValueError: unconverted data remains: +00:00
@rmartins90 rmartins90 changed the title error when deserializing datefield error when deserializing datetimefield Oct 11, 2015
@lauxley
Copy link
Contributor

lauxley commented Dec 1, 2015

Hi, thanks for the PR, the code makes perfect sense but do you have a use case ?
it's probably related to how dates are stored somewhere but since i don't reproduce I'd like to have at least a test case to make sure it doesn't break again later.

@sadnoodles
Copy link

sadnoodles commented May 18, 2017

May be same issue.

ValueError at /admin/type/
time data '2017-05-17T18:09:18' does not match format '%Y-%m-%dT%H:%M:%S.%f'

mysql version: Ver 14.14 Distrib 5.5.55, for debian-linux-gnu (x86_64) using readline 6.3.
No error using mysql version: Ver 14.14 Distrib 5.7.12, for Win64 (x86_64).
It seems lower version mysql doesn't support microseconds. The date format is: '%Y-%m-%dT%H:%M:%S' without '.%f'.

Add data is ok. But when you edit it and save (this will cause ES index updating), and search again, this error arise.
We can't update mysql for some reason. Help me.

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