Convert time zones

EasyDatetime Programs · 15 of 20

Write a Python program to convert 12:00 UTC to Indian Standard Time.

Advertisement
Output
2026-11-02 17:30 IST

Approach

  1. A fixed timezone(timedelta(hours=5, minutes=30)).

Solution

Python
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.

More datetime programs

← All 20 Datetime Programs

Leave a Comment