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

Add nanosecond support #80

Open
bschoening opened this issue May 8, 2023 · 1 comment
Open

Add nanosecond support #80

bschoening opened this issue May 8, 2023 · 1 comment

Comments

@bschoening
Copy link

ISO 8601 supports nanosecond level formats. For compatibility with implementations which utilize nanoseconds, its difficult to work around this incompatibility.

I realize the documentation mentions "fractional seconds are limited to microseconds", but no rationale is given for not aligning with the ISO 8601 precision.

@micahcochran
Copy link

micahcochran commented Sep 8, 2023

datetime objects only supports microsecond precision see. The isodate library parses the format then creates a datatime objects date, datetime, and time. timedelta do include milliseconds. The incompatibility is the Python standard library not supporting more precise divisions of the seconds.

isodate has its own Duration class, which could be extended. There would still be conversion issues from Duration to timedelta.

Here's an article which briefly discusses nanosecond support with a few examples and suggests using NumPy's datetime64.

Edit: Python 3.7 PEP 564 added nanoseconds functions. This does not impact what I discussed above. It added functions but did not seem to change existing functions. Provided for context.

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

2 participants