Python Practice › Datetime Programs › Program 15
Convert time zones
Write a Python program to convert 12:00 UTC to Indian Standard Time.
Output
2026-11-02 17:30 IST
Approach
- A fixed
timezone(timedelta(hours=5, minutes=30)).
Solution
from datetime import datetime, timedelta, timezone utc = datetime(2026, 11, 2, 12, 0, tzinfo=timezone.utc)ist = timezone(timedelta(hours=5, minutes=30), "IST")print(utc.astimezone(ist).strftime("%Y-%m-%d %H:%M %Z"))Output
2026-11-02 17:30 IST
Learn the concept
New to this topic? Read the lesson, then come back.