What it is
Arrow is a Python library that provides a sensible, human-friendly approach to creating, manipulating, formatting, and converting dates and times. It simplifies working with time zones and datetime arithmetic.
Arrow allows you to create datetime objects, shift them by time intervals, convert between time zones, format and parse strings, and perform human-readable operations.
Installation
pip install arrowGetting started
The smallest useful thing you can do with it, and what each part means.
import arrow
now = arrow.now()
print(now)import arrow
dt = arrow.get('2025-08-21 15:30', 'YYYY-MM-DD HH:mm')
print(dt)import arrow
now = arrow.now()
future = now.shift(days=+5, hours=+3)
print(future)Advanced usage
Where the library earns its place over a simpler alternative.
import arrow
now = arrow.now('UTC')
ny = now.to('America/New_York')
print(ny)import arrow
now = arrow.now()
print(now.format('YYYY-MM-DD HH:mm:ss'))import arrow
past = arrow.get('2025-08-01')
now = arrow.now()
print(past.humanize(now))import arrow
dt = arrow.get('21/08/2025', 'DD/MM/YYYY')
print(dt.format('YYYY-MM-DD'))Errors and fixes
The failures you are most likely to hit, and what actually resolves them.
- ParserError
- Ensure the input string matches the provided format string when parsing.
- ValueError
- Check that date and time components are valid and within acceptable ranges.
Best practices
- Use Arrow objects instead of Python datetime objects for simplicity and readability.
- Always specify a timezone when working with global applications.
- Use humanize for user-friendly time displays.
- Prefer `shift()` over manual datetime arithmetic.
- Use Arrow for parsing, formatting, and conversion to reduce boilerplate code.
Background
Why it exists, and what it was reacting to.
Arrow was created by Chris Smith to address the limitations of Python's standard `datetime` module. It focuses on simplicity, readability, and human-friendly operations, enabling developers to handle date and time in an intuitive manner.
