Replies: 1 comment
-
That seems like it would cause other issues (loss of millisecond-precision). Perhaps the numeric precision needs to be changed -- cc @oremanj |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It seems that the current implementation of type caster for datetime.datetime object doesn't allow very distant dates to be transfered (e.g. 2400-01-01). I need to transfer such date with seconds as Duration. In my case, a workaround was to replace line 167 in nanobind/stl/chrono.h :
value = ch::time_point_cast<Duration>( ch::system_clock::from_time_t(std::mktime(&cal)) + msecs);
by
value = type(Duration(std::mktime(&cal)));
and my super distant date are well transferred from python to c++. Would it be feasible to introduce such a feature in a next release ?
Beta Was this translation helpful? Give feedback.
All reactions