ytel-timezone-cron-convert
v1.1.1
Published
convert timezone of cron
Downloads
3
Readme
timezone-cron-convert
timezone-cron-convert is a JavaScript library that, given a cron expression, a source timezone and a destination timezone, transforms the cron expression for that timezone.
Installation
First, install the module:
npm install timezone-cron-convert
Then, depending upon your usage context, add a reference to it:
ESM / webpack
import { convert } from 'timezone-cron-convert';
Usage
convert("0 30 23 L * *", "UTC", "Africa/Lagos");
> "0 30 0 1 * *"
convert("0 30 0 1 * *", "Africa/Lagos", "UTC");
> "0 30 23 L * *"
convert("0 30 23 * * 2,6", "Africa/Lagos", "UTC");
> "0 30 0 * * 0,3"
convert("0 0 23 30 11 *", "UTC", "Africa/Lagos");
> "0 0 0 1 12 *"
License
timezone-cron-convert is freely distributable under the terms of the MIT license.