Convert local crontabs to UTC crontabs
Project description
local-crontab is a Python wheel and command line utility to convert a crontab, in a local timezone, into a set of UTC crontabs.
It creates multiple UTC crontabs because of Daylight Saving Time.
This project is based to local-crontab by UnitedIncome with some bugfixs.
Use it online!
TODO
Use as a script
$ local-crontab --help
Usage: command_line.py [OPTIONS] CRONTAB
Convert a crontab, in a localized timezone, into a set of UTC crontabs.
Options:
--t, --timezone TZ The timezone to use. Defaults to system timezone
--help Show this help message and exit.
--version Show program's version number and exit.
# year 2021
$ local-crontab --timezone America/New_York '0 10 * * *'
0 15 * 1-2 *
0 15 1-13 3 *
0 14 14-31 3 *
0 14 * 4-10 *
0 14 1-6 11 *
0 15 7-30 11 *
0 15 * 12 *
# year 2021
$ local-crontab --timezone America/Denver '0 10 * * *'
0 17 * 1-2 *
0 17 1-13 3 *
0 16 14-31 3 *
0 16 * 4-10 *
0 16 1-6 11 *
0 17 7-30 11 *
0 17 * 12 *
Use as a library
Install with pip install local-crontab
, then:
from local_crontab import Converter
Converter('0 10 * * *', 'America/New_York').to_utc_crons()
# returns
[ '0 15 * 1-2,12 *',
'0 15 1-10 3 *',
'0 14 11-31 3 *',
'0 14 * 4-10 *',
'0 14 1-3 11 *',
'0 15 4-31 11 *' ]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
local-crontab-0.1.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for local_crontab-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 184f440e6e25e17d8ee0fd0c1812f38d26c4469e2def2a6c07ac2942bf69b50d |
|
MD5 | 092304e56292a33ca8e22e2702ed800b |
|
BLAKE2b-256 | d3f65d5cb75eb1571578c00e2ee962e61ca94a2ff12122e7918bfb64a6bfca9d |