GithubHelp home page GithubHelp logo

Comments (3)

jhpratt avatar jhpratt commented on May 27, 2024

The value is expected to be a string, not an integer. Formatting and parsing is always done with strings.

from time.

ogarcia avatar ogarcia commented on May 27, 2024

The value is expected to be a string, not an integer. Formatting and parsing is always done with strings.

I understand then that it is impossible to deserialize a timestamp with milliseconds coming in an integer.

And you have not thought about including this possibility? It is not so rare nowadays to work with timestamps with milliseconds and the most normal thing is that they come as integers and not as strings.

In fact, I think it would be very interesting if it was even a module, something like time::serde::timestamp_millis. What do you think?

from time.

jhpratt avatar jhpratt commented on May 27, 2024

I have previously rejected that (on multiple occasions) because I assumed it could be replicated using the time::serde::format_description! macro. Given that it cannot and that time::serde::timestamp is serialized/deserialized as an integer, I would be fine with a PR adding it for milliseconds, microseconds, and nanoseconds.

from time.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.