timestamps.pxd 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. from cpython.datetime cimport (
  2. datetime,
  3. tzinfo,
  4. )
  5. from numpy cimport int64_t
  6. from pandas._libs.tslibs.base cimport ABCTimestamp
  7. from pandas._libs.tslibs.np_datetime cimport (
  8. NPY_DATETIMEUNIT,
  9. npy_datetimestruct,
  10. )
  11. from pandas._libs.tslibs.offsets cimport BaseOffset
  12. cdef _Timestamp create_timestamp_from_ts(int64_t value,
  13. npy_datetimestruct dts,
  14. tzinfo tz,
  15. bint fold,
  16. NPY_DATETIMEUNIT reso=*)
  17. cdef class _Timestamp(ABCTimestamp):
  18. cdef readonly:
  19. int64_t _value, nanosecond, year
  20. NPY_DATETIMEUNIT _creso
  21. cdef bint _get_start_end_field(self, str field, freq)
  22. cdef _get_date_name_field(self, str field, object locale)
  23. cdef int64_t _maybe_convert_value_to_local(self)
  24. cdef bint _can_compare(self, datetime other)
  25. cpdef to_datetime64(self)
  26. cpdef datetime to_pydatetime(_Timestamp self, bint warn=*)
  27. cdef bint _compare_outside_nanorange(_Timestamp self, datetime other,
  28. int op) except -1
  29. cdef bint _compare_mismatched_resos(_Timestamp self, _Timestamp other, int op)
  30. cdef _Timestamp _as_creso(_Timestamp self, NPY_DATETIMEUNIT creso, bint round_ok=*)