1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] How do I change timezone?

Discussão em 'Python' iniciado por Stack, Setembro 14, 2024.

  1. Stack

    Stack Membro Participativo

    I've done a clock in Python, but I have an one problem. The timezone is set on UTC but I want to change it to time in Warsaw. Can you help me?

    from tkinter import *
    from time import *


    def update():


    time_string = strftime("%H:%M:%S")
    time_label.config(text=time_string)

    day_string = strftime("%A")
    day_label.config(text=day_string)

    date_string = strftime("%B %d, %Y")
    date_label.config(text=date_string)

    window.after(1000,update)

    window = Tk()

    time_label = Label(window,font=("Arial",50),fg="#0000ff",bg="white")
    time_label.pack()

    day_label = Label(window,font=("Comic sans",25,"bold"))
    day_label.pack()

    date_label = Label(window,font=("Comic Sans MS",30))
    date_label.pack()

    update()

    window.mainloop()


    [​IMG]

    Continue reading...

Compartilhe esta Página