Skip to content

A Python package to set system time regardless of operating system

License

Notifications You must be signed in to change notification settings

cunarist/timesetter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Guide

Timesetter is a Python package to set system time regardless of operating system

Supported Platforms

  • Windows
  • Linux
  • macOS

Tips

  • This package aims to set system time in the precision of below milliseconds.
  • You need to pass a datetime object to the set function. If the timezone information was not included in the time object(naive), the package will assume that it's identical to the system.
  • You need to run your Python code with administration privileges for this package to work properly. Otherwise, PermissionError will be raised. This applies to all platforms.

How to Use

Install the package from PyPI

pip install timesetter

Then import it in your Python code

from datetime import datetime
import timesetter

target_time = datetime(year=2021, month=3, day=29, hour=15, minute=38, second=12)
timesetter.set(target_time)

For Maintainers

Preparation

  • The modern Python package manager uv is used for dependency resolution. Please ensure it is installed on your system before proceeding.
  • Code checking should always be enabled to maintain code quality. Make sure Ruff and Pyright are activated in your IDE.

Command Line Scripts

Generate the distribution archive to /dist

uv build

Upload the package to PYPI

uv publish

About

A Python package to set system time regardless of operating system

Resources

License

Stars

Watchers

Forks