Arrow Datetimes
Human-friendly time formatting & shifting.
How it Works
Provides an intelligent wrapper to standard python datetimes parsing.
Allows simplified shifts and human-readable string formats heavily.
Source Code
Parses complex strings and extrapolates native UTC variants.
arrow_demo.py
Try in Editorimport arrow
# Current UTC time
now = arrow.utcnow()
print(f"Now (UTC): {now.format('YYYY-MM-DD HH:mm:ss')}")
# Shift time forward
future = now.shift(days=14, hours=6)
print(f"Release date: {future.humanize()}")
print(f"Exact date: {future.format('dddd, MMMM Do YYYY')}")
# Parse chaotic string
parsed = arrow.get("2025-07-04T12:00:00-04:00")
print(f"\nParsed US/Eastern: {parsed}")
# Convert across timezones
import pytz
zones = ['Asia/Tokyo', 'Europe/London', 'America/New_York']
print("\nFuture Date around the world:")
for tz_name in zones:
tz = pytz.timezone(tz_name)
local_dt = future.datetime.astimezone(tz)
print(f" {tz_name:<25} {local_dt.strftime('%Y-%m-%d %H:%M %Z')}")Terminal Output
Now (UTC): 2025-XX-XX XX:XX:XX
Release date: in 14 days
Exact date: ...Real-world Applications
- Timezone conversions
- CRON log evaluation
- Database timestamp mutations