Title: tzupdate 用 IP geolocation 幫忙設定時間
Tags: Linux
Date: 2022/12/08 11:09
Category: calendar
Author: ThomasTsai
Summary: 安裝與設定 tzupdate
非常簡單:
$ pip install -U tzupdate
$ tzupdate -p
Asia/Taipei
就完成了...
reference: https://github.com/cdown/tzupdate
tzupdate is a fully automated utility to set the system time using geolocation.
Usage
$ sudo tzupdate
Set system timezone to Europe/London.
Internally, this geolocates you, gets the timezone for that geolocation, and then updates the system's local time zone.
You can also see what tzupdate would do without actually doing it by passing -p
, and specify an alternative IP address by using -a
. This is not an exhaustive list of options, see tzupdate --help
for that.
Installation
To install the latest stable version from PyPi (recommended):
$ pip install -U tzupdate
To install the latest development code from GitHub:
$ pip install -U git+https://github.com/cdown/tzupdate.git@develop
Testing
$ tox
Ran 18 tests in 1.109s