This is a simple Python script that synchronizes the system clock on Windows with an NTP (Network Time Protocol) server.
If you prefer to use a pre-built executable file instead of running the Python script, you can download the latest release from the Releases page.
-
Go to the Releases page.
-
Download the latest version of the executable file (
windows_time_synchronizer.exe). -
Double-click the downloaded file to run it.
The executable file provides a convenient way to synchronize the system clock without the need to install Python or any dependencies. You can also create a ntp_servers.txt file in the same directory as the executable to specify the desired NTP servers.
Note: The executable file is built from the same source code as the Python script, so it offers the same functionality.
If you encounter any issues or have any questions, please refer to the Issues page or contact the project maintainer.
- Python 3.x
- pip package manager
-
Clone the repository:
git clone https://github.com/kaseioo/windows_time_synchronizer.git
-
Install the required dependencies:
pip install -r requirements.txt
-
Open a terminal or command prompt.
-
Navigate to the project directory:
cd windows_time_synchronizer -
(Optional) Modify the
ntp_servers.txtfile to include the desired NTP servers. If no servers are specified, the script will use the default hardcoded NTP servers.notepad ntp_servers.txt
Each line in the file should contain the address of an NTP server, e.g.:
time.windows.com time.nist.gov -
Run the script in an elevated (administrator-level) terminal or command prompt:
python time_synchronizer.py
The script will automatically synchronize the system clock with an NTP server.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. Feel free to contact me if you have any questions. Otherwise, you can also fork the repository and use the code as you see fit.
This project relies on the ntplib library, which is licensed under the MIT License. The rest of the code is licensed under the BSD 3-Clause License. See the LICENSE file for details.