jmrozanec / jmrozanec/cron-utils
Migrate cron expression to another timezone
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 272
- PR merge metrics
- No merged PRs in 30d
Description
I need something like below:
> newCronExpression = convert (localCronExpresn,fromLocalTZ, "UTC")
Is it possible using cron-utils?
Let me give an example:
My local timezone is IST i.e. GMT+5.30.
Current local time is: 11:20 AM.
I want a job to run in 45 min of every hour.
So, my cron expression: 45 \* \* \* *
Hence I am expecting my job to run after 25 min ( as starting time is 11:45 AM)
but my job is running as per UTC, because of oozie.
Current time in UTC : 05:50 AM
As per cron expression 45 \* \* * , the starting time will be 06:45 AM at GMT.
So, the job will be actually started after 55 min.
> Expected : After 25 min
>
> Actual : After 55 min
So,
> if I am converting my local cron expression 45 *\* \* \* to 15 \* \* \* \* at GMT, then actual waiting period will be same as expected.
This feature was originally reported at [cron-utils-examples](https://github.com/jmrozanec/cron-utils-examples/issues/3) by @jrphub
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.