FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
datetime said midnight. Server logged 5 AM.
How-ToProgramming Languages

datetime said midnight. Server logged 5 AM.

via Dev.to PythonNico Reyes3h ago

datetime said midnight. Server logged 5 AM. Built a scheduler that ran tasks at midnight. Worked fine on my laptop. Deployed to AWS and everything started running at 5 AM. What happened I was scheduling database backups using Python's datetime. Simple code: from datetime import datetime , time import schedule def backup_database (): print ( f " Backup started at { datetime . now () } " ) # database backup logic here schedule . every (). day . at ( " 00:00 " ). do ( backup_database ) while True : schedule . run_pending () time . sleep ( 60 ) Ran it locally (Peru timezone UTC-5), worked perfect. Midnight backups like clockwork. Deployed to AWS EC2 instance (UTC timezone). Checked logs next morning and backups ran at 5 AM local time. Why it broke The schedule library uses local server time. My EC2 instance defaulted to UTC. When I said "00:00", it scheduled for UTC midnight, which is 5 AM Peru time. I assumed datetime was timezone aware. It's not unless you explicitly make it. What fixed

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
0 views

Related Articles

The Real Cost of Abstractions in .NET
How-To

The Real Cost of Abstractions in .NET

Medium Programming • 13m ago

Stop Learning Frameworks — You’re Wasting Your Time
How-To

Stop Learning Frameworks — You’re Wasting Your Time

Medium Programming • 1h ago

How to Self-Host n8n in 2026: VPS vs Managed Hosting (Full Comparison)
How-To

How to Self-Host n8n in 2026: VPS vs Managed Hosting (Full Comparison)

Dev.to • 1h ago

I Built a Mac App to Fix Android File Transfer — Here’s What I Learned
How-To

I Built a Mac App to Fix Android File Transfer — Here’s What I Learned

Medium Programming • 1h ago

How-To

What I learned about X-HEEP by Benchmarking

Medium Programming • 3h ago

Discover More Articles