---
source: https://iinventedlight.com/library/notes/pandas-time-series.md
title: "Time series and dates in pandas"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE); prose restates or closely paraphrases cited source lines"
license_family: pandas-bsd3
rule_check: "needs rule check (family not in auto-publish rule; check.mjs auto-approves only usgov and arxiv-ccby)"
attribution: "Summary by iinventedlight (AI-assisted). Sources: pandas docs, Time series / date functionality — pandas 3.1.1 documentation, BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE); pandas docs, How to handle time series data with ease — pandas 3.1.1 documentation, BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-04
status: published
checked_on: 2026-11-04
as_of: 2026-11-04
confidence: medium
untested: "No code was run for this note; only the fetched documentation pages were read."
category: coding-references
topic_area: "code-ai-eng: pandas"
tags: ['pandas', 'time-series', 'datetime']
sources:
  - id: S1
    title: "Time series / date functionality — pandas 3.1.1 documentation"
    publisher: pandas docs
    url: https://pandas.pydata.org/docs/user_guide/timeseries.html
    accessed: 2026-11-04
    license: "BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE)"
  - id: S2
    title: "How to handle time series data with ease — pandas 3.1.1 documentation"
    publisher: pandas docs
    url: https://pandas.pydata.org/docs/getting_started/intro_tutorials/09_timeseries.html
    accessed: 2026-11-04
    license: "BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE)"
---
# Time series and dates in pandas

**Answer:** pandas contains extensive capabilities and features for working with time series data for all domains. Using the NumPy datetime64 and timedelta64 dtypes, pandas has consolidated a large number of features from other Python libraries and created a tremendous amount of new functionality. (S1)

## Time concepts

- Date times: a specific date and time with timezone support. (S1)
- Time spans: a span of time defined by a point in time and its associated frequency. (S1)
- Date offsets: a relative time duration that respects calendar arithmetic. (S1)
- The default resolution for date times and time deltas is microsecond, though second, millisecond, and nanosecond are also supported. (S1)
- For time series data, it's conventional to represent the time component in the index of a Series or DataFrame. (S1)

## From strings to timestamps

- By applying the to_datetime function, pandas interprets the strings and converts these to datetime objects. (S2)
- pandas calls these datetime objects, similar to datetime.datetime from the standard library, pandas.Timestamp. (S2)
- Using pandas.Timestamp for datetimes enables us to calculate with date information and make them comparable. (S2)
- Subtracting timestamps gives a pandas.Timedelta object, similar to datetime.timedelta, which defines a time duration. (S2)

## Claims
- id: C1
  claim: pandas builds on datetime64 and timedelta64.
  source: S1
  evidence: "Using the NumPy datetime64 and timedelta64 dtypes"
- id: C2
  claim: Date offsets respect calendar arithmetic.
  source: S1
  evidence: "A relative time duration that respects calendar arithmetic."
- id: C3
  claim: to_datetime converts strings to datetimes.
  source: S2
  evidence: "By applying the to_datetime function"
- id: C4
  claim: Timestamps make dates comparable.
  source: S2
  evidence: "information and make them comparable."

## Sources
- [S1] Time series / date functionality — pandas 3.1.1 documentation. pandas docs. https://pandas.pydata.org/docs/user_guide/timeseries.html . License: BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE). Accessed 2026-11-04.
- [S2] How to handle time series data with ease — pandas 3.1.1 documentation. pandas docs. https://pandas.pydata.org/docs/getting_started/intro_tutorials/09_timeseries.html . License: BSD-3-Clause (pandas-dev/pandas LICENSE; Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team; Copyright (c) 2011-2026, Open source contributors; https://github.com/pandas-dev/pandas/blob/main/LICENSE). Accessed 2026-11-04.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
