[Numpy-discussion] Re: advice for using datetime64 in C binding

2022-02-18 Thread Benoit Gschwind
Hello, I found my ankser in own code ^^ static PyArray_Descr * create_datetime64_ms_dtype() { // Extrapolated from numpy sources PyArray_Descr * dtype = PyArray_DescrFromType(NPY_DATETIME); reinterpret_cast(dtype->c_metadata)->meta.base = NPY_FR_ms; return dtype; }

[Numpy-discussion] Re: advice for using datetime64 in C binding

2022-02-18 Thread Sebastian Berg
On Fri, 2022-02-18 at 15:53 +0100, Benoit Gschwind wrote: > Hello, > > I found my ankser in own code ^^ > > static PyArray_Descr * create_datetime64_ms_dtype() > { > // Extrapolated from numpy sources > PyArray_Descr * dtype = PyArray_DescrFromType(NPY_DATETIME); > reinter

[Numpy-discussion] Re: advice for using datetime64 in C binding

2022-02-18 Thread Benoit Gschwind
Thank you for fixing my code ! :) On Fri, 2022-02-18 at 09:00 -0600, Sebastian Berg wrote: > On Fri, 2022-02-18 at 15:53 +0100, Benoit Gschwind wrote: > > Hello, > > > > I found my ankser in own code ^^ > > > > static PyArray_Descr * create_datetime64_ms_dtype() > > { > > // Extrapolate