Skip to main content

A Python package to set system time regardless of operating system

Project description

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

Rules

Type hints as well as stub files for Python should be provided for the maintainability of the code. Turn on strict type checking in whatever IDE you are using. If some third party packages doesn't support type checking very well, then you can write # type: ignore to suppress the warning.

Command Line Scripts

Install packages written in requirements.txt from PyPI

pip install -r ./requirements.txt

Generate the distribution archive to /dist

python -m build

Upload the package to PYPI

python -m twine upload dist/*

Project details


Release history Release notifications | RSS feed

This version

1.8

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timesetter-1.8.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

timesetter-1.8-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file timesetter-1.8.tar.gz.

File metadata

  • Download URL: timesetter-1.8.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for timesetter-1.8.tar.gz
Algorithm Hash digest
SHA256 ee6523b155f6144e618217a58569098997b122b187d9a1a0940a5d32282e7da0
MD5 0761bf32368666dc31fb31136f30a88d
BLAKE2b-256 6262f9b35aeb93699628aec02574c3de06455632541693a1ced8c052d9429e8c

See more details on using hashes here.

File details

Details for the file timesetter-1.8-py3-none-any.whl.

File metadata

  • Download URL: timesetter-1.8-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for timesetter-1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1e207284c5027d512d3cea8292fbbe07bf5a1e0bd5b65983c4f5ddb5faa1d704
MD5 7166cd5cafe7a976f19a596a6d09ca1d
BLAKE2b-256 6750f2d1f4f5cd2fad7061632a16144ff2ccf1640a452a2114041b4c4cf60d40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page