Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

One-Click Windows Time & Timezone Resync

License: MIT Platform Language GitHub release GitHub last commit


One-click self-healing clock and timezone fixer for Windows 10 & 11.
Built for laptops plagued by dying CMOS batteries, sleep/wake desyncs, and unresponsive Windows Time services.


🔋 The Story Behind It

This utility was born out of pure frustration with a laptop battery issue that wiped the system time on every reboot. Instead of dealing with failed "Sync now" buttons and restarting Windows services manually, this script automates the entire recovery in one click.

This script automates the entire triage: it enables location auto-updates, tests standard NTP peers, and if the sync fails, automatically rebuilds the Windows Time catalog and injects fallback NTP servers until the clock is accurate.


🛑 Why You Need This 🛑

When a laptop battery drains to 0% (or the small internal battery is worn out esp on old laptop/PC), Windows will forgets the correct time. When this happens:

  • Websites won't load: Your browser warns that "Your connection is not private" because the date is wrong.
  • Apps won't log in: Apps like Discord, WhatsApp, Steam, or email refuse to connect.
  • Windows won't fix itself: The "Sync now" button in Windows Settings often gets stuck spinning or shows an error.

Winsync-time.bat fixes this in a single click: it auto-elevates to Administrator, sets your time zone via Windows location services, and forces an immediate network resynchronization. If the standard sync fails, it triggers an automatic repair sequence to rebuild the time service and restore your clock.


Features

  • Auto-Elevation: Automatically triggers the Windows UAC prompt to request required administrative privileges.
  • Location-Aware Time Zone: Configures and starts the tzautoupdate service so Windows dynamically selects the correct local time zone.
  • Forced Resync: Restarts the Windows Time Service (w32time) and forces an immediate NTP query against configured time servers.
  • Zero Dependencies: Pure Batch/PowerShell; runs natively out of the box.
  • Automated Self-Healing: Detects sync failures (e.g., service unresponsiveness or registry corruption), automatically unregisters/reregisters w32time, applies fallback NTP server pools, and completes the sync without requiring manual intervention.

Requirements

  • Windows 10 or Windows 11
  • Active internet connection
  • Location Services enabled (Settings > Privacy & security > Location) for automatic time zone updates

Usage

Option 1: Double-Click

  1. Download sync-time.bat.
  2. Double-click the file.
  3. Click Yes when prompted by User Account Control (UAC).

Option 2: Command Line (Admin)

git clone https://github.com/Elham1x0/OneClick-windows-time-resync.git
cd windows-time-resync
sync-time.bat

About

One-click batch utility to resync time, auto-detect time zone, and self-heal corrupted time services on Windows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages