
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
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.
Check it out at sonic0.github.io/local-crontab-web-converter
$ 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 * *
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 * *'
This repo is part of my projects group, called Cron-Converter. Its related repositories:
FAQs
Convert local crontabs to UTC crontabs
We found that local-crontab demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.