Comments (7)
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.
I think this is OK.
from maya.
i think one second of accuracy is acceptable for most use cases :)
from maya.
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.
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.
@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.
@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)
- 'regex._regex_core'; 'regex' is not a package HOT 3
- pip3 install maya doesn't install out of the box in python slim docker container. HOT 3
- Not friendly to Chinese HOT 2
- Inconsistency between date and datetime HOT 9
- UnicodeDecodeError with pip install maya on Windows 10 HOT 2
- Reference document for acceptable date formats HOT 2
- Fix simple typo: quanitzed -> quantized
- BST O! what a mess
- dateparser >=0.7.5 is not compatible with Python 2.7 HOT 1
- maya.parse fails on certain dates.
- Package not compatible with next version of tzlocal HOT 1
- Architecture not supported - Mac OS 10.15 in pipenv
- AttributeError: 'MayaDT' object has no attribute 'snap_tz' HOT 1
- Incorrect Results for Parssing Data Time HOT 1
- Looking for a new maintainer HOT 3
- Invalid date format - %Y\%m\%d
- day_first parse when year_first format does nothing? HOT 1
- Test failure with Python 3.12 HOT 2
- transfer back to @kennethreitz HOT 5
- fallback timezone for parse() should be local timezone not UTC
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maya.