GithubHelp home page GithubHelp logo

Comments (7)

mithrandi avatar mithrandi commented on September 28, 2024 3

For those who care: the bug is caused by the float type having insufficient precision to represent the underlying POSIX timestamp correctly. The further away you get from the POSIX epoch (in either direction), the more precision you'll lose in the timestamp.

from maya.

kennethreitz avatar kennethreitz commented on September 28, 2024 1

I think this is OK.

from maya.

kennethreitz avatar kennethreitz commented on September 28, 2024

i think one second of accuracy is acceptable for most use cases :)

from maya.

alexwlchan avatar alexwlchan commented on September 28, 2024

But think of the children*!

Seriously though, this looks pretty cool. Props for writing it. (I’ll stop trying to break it now.) 🙂


*’s children’s children’s … children’s need for second-level accurate, human-friendly datetime libraries in the future.

from maya.

glyph avatar glyph commented on September 28, 2024

IMHO this is a valid bug and should be addressed. Perhaps not with super high priority, but although it creeps up past a second in 2243, the inaccuracy is creeping up by various sub-second values on the way there.

The solution might not be all that hard, either. What about just storing the date internally as a Decimal?

from maya.

mithrandi avatar mithrandi commented on September 28, 2024

@glyph The inaccuracy creeps up past a microsecond in 2243; it only creeps up past a second in the year 285572427 or so. I don't think using Decimal internally will help much, since datetime is heavily involved here, and does not support conversion from Decimal.

from maya.

glyph avatar glyph commented on September 28, 2024

@mithrandi Thanks for the correction. The title of the bug did sound pretty extreme (gaining an "extra second") but time is weird and float time doubly so, so I didn't double check :).

from maya.

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.