World Clock
import datetime
import pytz
import time
import os
# List of time zones to display
time_zones = {
"New York": "America/New_York",
"London": "Europe/London",
"Dubai": "Asia/Dubai",
"Mumbai": "Asia/Kolkata",
"Tokyo": "Asia/Tokyo",
"Sydney": "Australia/Sydney"
}
while True:
os.system('cls' if os.name == 'nt' else 'clear') # Clear terminal screen
print("🕒 World Clock - Updated Every Second\n")
for city, tz in time_zones.items():
zone = pytz.timezone(tz)
current_time = datetime.datetime.now(zone).strftime('%Y-%m-%d %H:%M:%S')
print(f"{city:10}: {current_time}")
time.sleep(1) # Wait for 1 second before refreshing
Code output
🕒 World Clock - Updated Every Second
New York : 2025-07-07 08:22:01
London : 2025-07-07 13:22:01
Dubai : 2025-07-07 16:22:01
Mumbai : 2025-07-07 17:52:01
Tokyo : 2025-07-07 21:22:01
Sydney : 2025-07-07 22:22:01