from tkinter import *
from datetime import datetime
import pytz
root = Tk()
root.title("Fuso Horário")
root.geometry("500x250")
root.resizable(False,False)
def times():
timezone = pytz.timezone('America/New_York')
hora_local = datetime.now(timezone)
tempo_actual = hora_local.strftime('%H:%M:%S')
horas1.config(text=tempo_actual)
horas1.after(200,times)
timezone1 = pytz.timezone('Africa/Luanda')
hora_local1 = datetime.now(timezone1)
tempo_actual1 = hora_local1.strftime('%H:%M:%S')
horas2.config(text=tempo_actual1)
horas2.after(200, times)
timezone2 = pytz.timezone('Europe/Luxembourg')
hora_local2 = datetime.now(timezone2)
tempo_actual2 = hora_local2.strftime('%H:%M:%S')
horas3.config(text=tempo_actual2)
horas3.after(200, times)
timezone3 = pytz.timezone('Asia/Macau')
hora_local3 = datetime.now(timezone3)
tempo_actual3 = hora_local3.strftime('%H:%M:%S')
horas4.config(text=tempo_actual3)
horas4.after(200, times)
nome1 = Label(text='Nova Iorque',font=("arial",'13','bold'))
nome1.place(relx=0.15,rely=0.05)
horas1 = Label(font=("arial",'12','bold'))
horas1.place(relx=0.15,rely=0.15)
nome2 = Label(text='Luanda',font=("arial",'13','bold'))
nome2.place(relx=0.6,rely=0.05)
horas2 = Label(font=("arial",'12','bold'))
horas2.place(relx=0.6,rely=0.15)
nome3 = Label(text='Luxamburgo',font=("arial",'13','bold'))
nome3.place(relx=0.15,rely=0.5)
horas3 = Label(font=("arial",'12','bold'))
horas3.place(relx=0.2,rely=0.6)
nome4 = Label(text='Macau',font=("arial",'13','bold'))
nome4.place(relx=0.6,rely=0.5)
horas4 = Label(font=("arial",'12','bold'))
horas4.place(relx=0.6,rely=0.6)
times()
root.mainloop()
Comentários
Enviar um comentário