Ask coding questions

← Back to all posts
I am in the eastern time zone but when I run the program, the time output is 4 hours ahead of me.
EthanJohnson11

I don't think I need to specify my time zone. When I run the program on python on my PC, I get my local time.

Voters
Oliver-Miller-bot
AA27RON
DanielCothran
KhushiKANODIA
DominicHuieWhit
EthanJohnson11
Comments
hotnewtop
Roar123

To make this work on repl.it, you should probably specify the timezone. By default, the timezone is Coordinated Universal Time, or UTC. Using datetime.now() gets the local time, but when using repl.it, the code is processed on their servers and sent back to you. I would imagine they would use UTC rather than their timezone. Here's a timezone example: