numpy
2.0.0
|
#include <Python.h>
#include <time.h>
#include <numpy/arrayobject.h>
#include "npy_config.h"
#include "npy_pycompat.h"
#include "numpy/arrayscalars.h"
#include "methods.h"
#include "_datetime.h"
#include "datetime_strings.h"
Defines | |
#define | PY_SSIZE_T_CLEAN |
#define | NPY_NO_DEPRECATED_API NPY_API_VERSION |
#define | _MULTIARRAYMODULE |
Typedefs | |
typedef time_t | NPY_TIME_T |
Functions | |
static int | get_localtime (NPY_TIME_T *ts, struct tm *tms) |
static int | convert_datetimestruct_utc_to_local (npy_datetimestruct *out_dts_local, const npy_datetimestruct *dts_utc, int *out_timezone_offset) |
NPY_NO_EXPORT int | parse_iso_8601_datetime (char *str, Py_ssize_t len, NPY_DATETIMEUNIT unit, NPY_CASTING casting, npy_datetimestruct *out, NPY_DATETIMEUNIT *out_bestunit, npy_bool *out_special) |
NPY_NO_EXPORT int | get_datetime_iso_8601_strlen (int local, NPY_DATETIMEUNIT base) |
static NPY_DATETIMEUNIT | lossless_unit_from_datetimestruct (npy_datetimestruct *dts) |
NPY_NO_EXPORT int | make_iso_8601_datetime (npy_datetimestruct *dts, char *outstr, int outlen, int local, int utc, NPY_DATETIMEUNIT base, int tzoffset, NPY_CASTING casting) |
NPY_NO_EXPORT PyObject * | array_datetime_as_string (PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds) |
#define _MULTIARRAYMODULE |
#define NPY_NO_DEPRECATED_API NPY_API_VERSION |
#define PY_SSIZE_T_CLEAN |
typedef time_t NPY_TIME_T |
NPY_NO_EXPORT PyObject* array_datetime_as_string | ( | PyObject * | NPY_UNUSEDself, |
PyObject * | args, | ||
PyObject * | kwds | ||
) |
static int convert_datetimestruct_utc_to_local | ( | npy_datetimestruct * | out_dts_local, |
const npy_datetimestruct * | dts_utc, | ||
int * | out_timezone_offset | ||
) | [static] |
<
<
References is_leapyear(), and npy_datetimestruct::year.
NPY_NO_EXPORT int get_datetime_iso_8601_strlen | ( | int | local, |
NPY_DATETIMEUNIT | base | ||
) |
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
static int get_localtime | ( | NPY_TIME_T * | ts, |
struct tm * | tms | ||
) | [static] |
<blockquote> maximum year it can represent is 2038 (see [1] for more details). Trying to use a higher date like 2041 in the 32 bit "ts" variable below will typically result in "ts" being a negative number (corresponding roughly to a year ~ 1905). If NPY_TIME_T is 64 bit, then there is no such problem in practice.</blockquote>
Referenced by parse_iso_8601_datetime().
static NPY_DATETIMEUNIT lossless_unit_from_datetimestruct | ( | npy_datetimestruct * | dts | ) | [static] |
NPY_NO_EXPORT int make_iso_8601_datetime | ( | npy_datetimestruct * | dts, |
char * | outstr, | ||
int | outlen, | ||
int | local, | ||
int | utc, | ||
NPY_DATETIMEUNIT | base, | ||
int | tzoffset, | ||
NPY_CASTING | casting | ||
) |
NPY_NO_EXPORT int parse_iso_8601_datetime | ( | char * | str, |
Py_ssize_t | len, | ||
NPY_DATETIMEUNIT | unit, | ||
NPY_CASTING | casting, | ||
npy_datetimestruct * | out, | ||
NPY_DATETIMEUNIT * | out_bestunit, | ||
npy_bool * | out_special | ||
) |
<blockquote> which will be used if it is.</blockquote>
<blockquote> resolution provided in the string, or -1 for NaT.</blockquote>
References _datetime_strings, can_cast_datetime64_units(), npy_datetimestruct::day, get_localtime(), npy_datetimestruct::month, npy_casting_to_string(), NPY_FR_D, and npy_datetimestruct::year.