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

Time field wrong result with microseconds #464

Closed
Archelyst opened this issue May 27, 2016 · 1 comment
Closed

Time field wrong result with microseconds #464

Archelyst opened this issue May 27, 2016 · 1 comment
Labels

Comments

@Archelyst
Copy link
Contributor

I have a schema with a Time field. When it serializes a value with microseconds, e.g. 2016-05-27T11:02:35.267899, it results in 2016-05-27T1.

The reason are those lines:

if value.microsecond:
    return ret[:12]

https://github.com/marshmallow-code/marshmallow/blob/dev/marshmallow/fields.py#L911

I have no idea what your idea was behind that, @sloria . ret[:19] would do it in my case, don't know if there might be other cases.

@sloria
Copy link
Member

sloria commented May 30, 2016

Certainly looks like a bug. I'd gladly review and merge a PR fixing this.

vuonghv added a commit to vuonghv/marshmallow that referenced this issue Jul 16, 2016
When a Time object has microsecond value, the _serialize() method
returns the following string format: 'HH:mm:ss.SSSSSS'
    marshmallow-code#464
vuonghv added a commit to vuonghv/marshmallow that referenced this issue Jul 16, 2016
When a Time object has microsecond value, the _serialize() method
returns the following string format: 'HH:mm:ss.SSSSSS'
    marshmallow-code#464
sloria pushed a commit that referenced this issue Jul 22, 2016
When a Time object has microsecond value, the _serialize() method
returns the following string format: 'HH:mm:ss.SSSSSS'
    #464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants