forked from sunidhi2001/Hacktoberfest2022-accepted
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreatedWorldClock.py
15 lines (15 loc) · 957 Bytes
/
CreatedWorldClock.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from datetime import datetime
import pytz
Country_Zones = ['America/New_York', 'Asia/Kolkata', 'Australia/Sydney',
'Canada/Atlantic', 'Brazil/East','Chile/EasterIsland', 'Cuba', 'Egypt',
'Europe/Amsterdam', 'Europe/Athens', 'Europe/Berlin', 'Europe/Istanbul',
'Europe/Jersey', 'Europe/London', 'Europe/Moscow', 'Europe/Paris',
'Europe/Rome', 'Hongkong', 'Iceland', 'Indian/Maldives', 'Iran',
'Israel', 'Japan', 'NZ', 'US/Alaska', 'US/Arizona', 'US/Central',
'US/East-Indiana']
country_time_zones = []
for country_time_zone in Country_Zones:
country_time_zones.append(pytz.timezone(country_time_zone))
for i in range(len(country_time_zones)):
country_time = datetime.now(country_time_zones[i])
print(f"The date of {Country_Zones[i]} is {country_time.strftime('%d-%m-%y')} and The time of {Country_Zones[i]} is {country_time.strftime('%H:%M:%S')}")