Timezone Hopping with Pendulum: Seamlessly Manage Time across Different Timezones – Data Science 2026
Working with data that spans multiple timezones is a daily reality in global data science projects. Converting, comparing, and displaying timestamps across UTC, New York, London, Tokyo, and others used to be painful. Pendulum makes timezone hopping effortless, readable, and reliable — turning complex timezone logic into simple, one-line operations.
TL;DR — Pendulum Timezone Superpowers
.in_timezone(tz)→ instant conversionpendulum.parse(..., tz=...)→ parse directly into any timezonependulum.now(tz)→ current time in any zone- Beautiful, human-friendly API
1. Basic Timezone Conversion
import pendulum
# Parse once, then hop anywhere
dt = pendulum.parse("2026-03-19 14:30:00", tz="UTC")
print("UTC:", dt)
print("New York:", dt.in_timezone("America/New_York"))
print("London:", dt.in_timezone("Europe/London"))
print("Tokyo:", dt.in_timezone("Asia/Tokyo"))
2. Real-World Data Science Examples
import pandas as pd
import pendulum
df = pd.read_csv("global_sales.csv", parse_dates=["order_time"])
# Convert all timestamps to multiple timezones
df["order_utc"] = df["order_time"].apply(lambda x: pendulum.parse(x, tz="UTC"))
df["order_ny"] = df["order_utc"].apply(lambda x: x.in_timezone("America/New_York"))
df["order_london"] = df["order_utc"].apply(lambda x: x.in_timezone("Europe/London"))
# Local hour analysis
df["hour_ny"] = df["order_ny"].apply(lambda x: x.hour)
df["hour_london"] = df["order_london"].apply(lambda x: x.hour)
3. Current Time in Any Timezone
# Current time anywhere in the world
now_ny = pendulum.now("America/New_York")
now_tokyo = pendulum.now("Asia/Tokyo")
now_utc = pendulum.now("UTC")
print(f"Right now in New York: {now_ny}")
print(f"Right now in Tokyo: {now_tokyo}")
4. Best Practices in 2026
- Always parse with an explicit
tzparameter - Store data internally in UTC and convert only for display or local analysis
- Use Pendulum’s
in_timezone()for clean, chainable conversions - Combine with pandas
.apply()for fast vectorized timezone hopping - Document the source timezone of any incoming data
Conclusion
Timezone hopping with Pendulum turns what used to be a headache into a pleasure. Its simple, readable API lets you parse, convert, and display times across any timezone with minimal code. In 2026 data science projects, Pendulum is the go-to library for handling global timestamps cleanly and correctly — saving you time, reducing bugs, and making your time-based analysis accurate and professional.
Next steps:
- Take any dataset with timestamps and add columns for key timezones using Pendulum’s
in_timezone()