-
Notifications
You must be signed in to change notification settings - Fork 68
Conversion from Python datetime to Julia DateTime fails #265
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
Comments
Hmm I think this is because a Julia I could add a conversion rule so that if you specifically ask for a |
Such a conversion would work fine for what I am doing. Thanks. |
In the meantime, you can do this to get the time to the nearest second: using CondaPkg
using PythonCall
using Dates
datetime = pyimport("datetime")
t = datetime.datetime.now()
# t = t.replace(microsecond=0) # nearest second
t = t.replace(microsecond=(t.microsecond//1000)*1000)
pyconvert(DateTime, t) |
This issue has been marked as stale because it has been open for 30 days with no activity. If the issue is still relevant then please leave a comment, or else it will be closed in 7 days. |
Your proposition gives me a stacktrace:
I tried to add
But honestly, converting a Python Note: this is now with PythonCall 0.9.14 |
It's The In the future, I'm planning to add keyword args to |
results in
with the minimalist CondaPkg.toml
but it fails with Python 3.10 and 3.11 too.
This is with CondaPkg v0.2.17 and PythonCall v0.9.10
The text was updated successfully, but these errors were encountered: