Pendulum is a modern, human-friendly alternative to Python’s built-in datetime module — and in 2026 it remains one of the most popular third-party libraries for anyone who works with dates, times, timezones, and durations on a regular basis.
Why do developers love it? It fixes almost every pain point of the standard library: confusing timezone handling, awkward parsing, verbose syntax, DST headaches, and poor readability. Pendulum gives you a single, intuitive object that just works.
Installation
pip install pendulum
Parsing Time – The Most Loved Feature
The pendulum.parse() function is incredibly smart — it understands almost any reasonable date/time string format without you having to specify a format string.
import pendulum
# Different formats — all work automatically
dt1 = pendulum.parse("2026-03-15 14:30:00")
dt2 = pendulum.parse("15 March 2026 2:30pm")
dt3 = pendulum.parse("2026-03-15T14:30:00+05:00")
dt4 = pendulum.parse("tomorrow at 3pm")
dt5 = pendulum.parse("now")
print(dt1) # 2026-03-15 14:30:00+00:00
print(dt4) # tomorrow's date at 15:00 in local timezone
Tip 2026: Use strict=True if you want to reject ambiguous or risky strings.
Working with Timezones (Much Easier than datetime)
Pendulum is timezone-aware by default — no more naive vs aware confusion.
# Parse with explicit timezone
dt = pendulum.parse("2026-03-15 14:30:00", tz="Asia/Karachi")
print(dt) # 2026-03-15 14:30:00+05:00
# Change timezone easily
dt_ny = dt.in_tz("America/New_York")
print(dt_ny) # 2026-03-15 04:30:00-04:00 (handles DST automatically)
# Get current time in any timezone
now_in_tokyo = pendulum.now("Asia/Tokyo")
print(now_in_tokyo)
Relative Time & Human-Friendly Strings
Pendulum shines when you need human-readable differences.
past = pendulum.parse("2025-12-01")
now = pendulum.now()
print(now.diff_for_humans(past))
# Output: "2 months ago"
print(now.diff_for_humans(past, absolute=True))
# Output: "2 months"
print(now.add(days=3).diff_for_humans())
# Output: "in 3 days"
Powerful Manipulation
Adding/subtracting time is clean and natural.
dt = pendulum.now()
print(dt.add(days=5, hours=3)) # 5 days and 3 hours from now
print(dt.subtract(months=2)) # 2 months ago
print(dt.start_of("month")) # First day of current month at 00:00
print(dt.end_of("year")) # Last day of year at 23:59:59.999999
print(dt.next(pendulum.SATURDAY)) # Next Saturday from now
Formatting & Parsing Edge Cases
Pendulum handles almost any format automatically, but you can also force a format:
dt = pendulum.from_format("15-03-2026 14:30", "DD-MM-YYYY HH:mm")
print(dt) # 2026-03-15 14:30:00+00:00
Common Pitfalls & Best Practices
- Use
tzargument on parse() orin_tz()for awareness - Always work in UTC internally, convert for display
- Prefer
pendulum.now("UTC")overdatetime.utcnow() - Handle DST automatically — Pendulum does it correctly
Conclusion
Pendulum turns one of Python’s most painful areas — dates, times, and timezones — into something enjoyable. In 2026, when building global apps, real-time systems, or AI pipelines, Pendulum saves hours of frustration compared to raw datetime.
Once you start using it, going back to the standard library feels like stepping backwards in time.