| datetime | Delorean | Arrow | Pendulum | NumPy1 | Pandas | |
|---|---|---|---|---|---|---|
| naive time | ✔ | ✘ | ✘ | ✘ | ✔ | ✔ |
| localized time | ✔ | ✔ | ✔ | ✔ | ✘ | ✔ |
| date | ✔ | ✘ | ✘ | ✔ | ✔2 | ✔2 |
| time of day | ✔ | ✘ | ✘ | ✔ | ✘ | ✘ |
| time range | 1-9999 | 1-9999 | 1-9999 | 1-9999 | 1678-2262 | 1678-2262 |
| time resolution | 1 µs | 1 µs | 1 µs | 1 µs | 1 ns | 1 ns |
| date range | 1-9999 | 1-9999 | huge | huge | ||
| rounding | ✘ | ✔ | ✔ | ✔ | ✘ | ✔ |
| parsing | strptime | udatetime | strptime custom |
strptime custom |
limited | strptime custom |
| formatting | strftime | Babel | custom | strftime custom |
✘ | strftime |
| locales | POSIX3 | ✘ | custom | custom | ✘ | ✘ |
| humanizing | ✘ | ✔ | ✔ | ✔ | ✘ | ✘ |
| implementation | C | Python | Python | Python | C | Cython |
| internal repr | components | datetime |
datetime |
datetime |
ticks | datetime+ns |
| memory use4 | 40 | 220 | 512 | 448 | 40 (single) 8 (bulk) |
120 (single) 8 (bulk) |
1 For NumPy, we consider “datetime64[ns]” for times and “datetime64[D]” for dates.
2 NumPy and Pandas represent dates as “datetime64[D]”, i.e. times with 1 day precision.
3 datetime’s strftime formatting honors the POSIX locale, but this must be set globally in the process, and locales may not be set up on all computers.
4 Estimates of memory use in bytes for single time values. See appendix for details. NumPy and Pandas store times as 8-byte values in collections (NumPy arrays; Pandas indexes, series, dataframes), but single objects consume more memory.