-
Notifications
You must be signed in to change notification settings - Fork 39
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
Wrong result with date2num
#140
Comments
cftime cannot currently handle fractional seconds in the reference date. |
That is unfortunate... |
It's a bug - it should work. |
I belive the bug is here: Line 226 in ec52b87
Even python datetime arithmetic can handle this: delta = t.to_pydatetime() - reftime.to_pydatetime()
print(type(delta), delta.total_seconds()) Output: <class 'datetime.timedelta'> -271.99 |
It's a simple fix, PR coming... |
jswhit
added a commit
that referenced
this issue
Feb 5, 2020
jswhit
added a commit
that referenced
this issue
Feb 5, 2020
fix for issue #140 (fraction seconds in reference date)
Fixed by PR #141 - works now in master and will be in 1.1.0 release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cftime.date2num
is returning a wrong result. See example below:Output:
The answer should be:
Output:
The text was updated successfully, but these errors were encountered: