Skip to main content

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 bug fixes.

I added the possibility to convert a crontab, in a local timezone, into an UTC crontab, but only for hour and day parts. This feature is useful to automate some simple convertions, but it is necessary a "dst check" program (external) to maintain the sync during the year with original local timezone. This feature in not available to online converter.

Use it online!

Check it out at sonic0.github.io/local-crontab-web-converter

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 *

# year 2021, month july
$ local-crontab --timezone America/New_York --shift '0 23 3 * *'
0 3 4 * *

Use as a library

Install with pip install local-crontab:

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 *']                                               
from local_crontab import Converter
Converter('0 23 3 * *', 'America/New_York').to_utc_cron()
# returns
'0 3 4 * *'                                      

Project info

This repo is part of my projects group, called Cron-Converter. Its related repositories:

Release files for local-crontab 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for local-crontab 0.3.0
File Size Uploaded
local-crontab-0.3.0.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for local-crontab 0.3.0
File Interpreter ABI Platform
local_crontab-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.1 kB

Release files / local-crontab-0.3.0.tar.gz

Download URL local-crontab-0.3.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
445b45cb9d0b568d789a701935816a7cf3de41e6ba22accbce6a816ce4c029af
BLAKE2b-256 checksum
How to use checksums
530cbd85d92aa514b74379076849ba79a6beff54280fe90d5b0033be75f5a0d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.10

Release files / local_crontab-0.3.0-py3-none-any.whl

Download URL local_crontab-0.3.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6871a3ab40ee13df2fffcb6dd793a83bf4af23c5db9785079f4a33ce7407105b
BLAKE2b-256 checksum
How to use checksums
dac273ca451f6a82706062aff5fb588cb2f120b42b3045af798e90ccb279fa04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page