CronExpression every 2 days - cron

I know this question was asked before. But the answers in those questions are not correct in my opinion.
I want to have a CronExpression for (Quartz) that schedules every 2 days.
The CronExpression "should be" 0 0 0 1/2 * ? *.
BUT: Starting today (9th October 2017) CronMaker shows that this is not true. This expression basically means: schedule every 2 days starting on the first of each month. That means: starting on 9th October 2017 the next times are:
Wednesday, October 11, 2017 12:00 AM
Friday, October 13, 2017 12:00 AM
Sunday, October 15, 2017 12:00 AM
Tuesday, October 17, 2017 12:00 AM
Thursday, October 19, 2017 12:00 AM
Saturday, October 21, 2017 12:00 AM
Monday, October 23, 2017 12:00 AM
Wednesday, October 25, 2017 12:00 AM
Friday, October 27, 2017 12:00 AM
Sunday, October 29, 2017 12:00 AM
Tuesday, October 31, 2017 12:00 AM
Wednesday, November 1, 2017 12:00 AM
As you can see: There is only 1 day between the two last times.
So when I'm using freeformatter to describe the cronexpression it states:
At 00:00:00am, every 2 days starting on the 1st, every month
Well that is shown in the listed times above. But I need something that correctly fires every 2 days.
Tuesday, October 31, 2017 12:00 AM
Thursday, November 2, 2017 12:00 AM
and so on.
Apparently the simple trigger from quartz is not a real option for me!

It's becouse you misunderstood how cron expression works. For every month it will starts from first day of month. If it would work otherly, the next month wouldn't fit 1/2 part of expression.
For more detailed explanation, look here:
Quartz.net - Repeat on day n, of every m months?

Related

How to instruct cron to execute a job in airflow Run every 3rd Jan, 3rd April, 3rd July, 3rd Oct at 11:00 AM UTC Time Zone

How to instruct cron to execute a job in airflow Run every 22nd Jan, 22nd April, 22nd July, 22nd Oct at 11:00 AM UTC Time Zone.
I have written below cron command to execute in airflow but it is not running at per scheudled
schedule_interval="0 11 22 1/3 *"
A cron-to-human-translator such as crontab.guru is a convenient tool for writing cron expressions:
0 11 22 1,4,7,10 *
0 = Minute 0
11 = Hour 11
22 = Day 22
1,4,7,10 = Months January, April, July, and October
* = Any day of the week
By default, UTC is applied in Airflow, but you can configure this globally (AIRFLOW__CORE__DEFAULT_TIMEZONE), or per DAG. See documentation: https://airflow.apache.org/docs/apache-airflow/stable/timezone.html#default-time-zone.

Gmail - Schedule send

I wish gmail gave more Schedule send times by default - not just default
Tomorrow morning Mar 24, 8:00 AM
Tomorrow afternoon Mar 24, 1:00 PM
Monday morning Mar 30, 8:00 AM
I'd love to have options like
in 2 minutes
in 10 minutes
in 1 hour
in 2 hours
in case I realize I need to add something ...
I guess we need to write a browser extension for that
but you never know that's why I'm asking here ...
any advice?
thank you ...

Identify Excel min and max dates, per day

I am finding good information here on working with dates, but so far I have not had any luck finding exactly what I want to do.
I have a column that is responsible for generating a date/time stamp for each entry in a particular row, and that date/time column spans across days.
Here is an example of the date/time column:
April 04, 2018 07:45
April 04, 2018 12:51
April 04, 2018 14:39
April 04, 2018 22:10
April 05, 2018 11:36
April 05, 2018 18:22
April 06, 2018 11:30
April 06, 2018 11:29
April 06, 2018 22:45
April 07, 2018 10:48
April 08, 2018 04:30
April 08, 2018 13:14
To be sure, these are actual Excel date/time entries that are formatted and conform to Excel such that Datetime functions will work with them.
There can be (and are) numerous entries per day, each row contains a datetime stamp, and I specifically need to designate the first entry and last entry for each specific day.
Here is an output example (from the data above) that hopefully will clear up any confusion around my question.
April 04, 2018 07:45 First
April 04, 2018 12:51
April 04, 2018 14:39
April 04, 2018 22:10 Last
April 05, 2018 11:36 First
April 05, 2018 18:22 Last
April 06, 2018 11:30 First
April 06, 2018 11:29
April 06, 2018 22:45 Last
April 07, 2018 10:48 First
April 08, 2018 04:30 First
April 08, 2018 13:14 Last
I recognize the 7th doesn't have a logical last date, but I figure I can address with with error handling once I am able to address the initial issue.
The function MIN in this case =MIN(A2:A64) would just return April 04, 2018 07:45, which is correct for that day, but only because it is the earliest among all of the dates, and not specific to the day itself.
Any ideas how I can find the min and max within days rather than across days?
Thank you in advance!
-John
I wish you had posted your data sample in a more universal date format, i.e. no comma before the year and the month as a number. I spent twice as much time cleaning up the data to get this into a date/time stamp than I needed to work out the answer.
If the data is sorted, then you can use this formula:
=IF(INT(A3)>INT(A2),"first",IF(INT(A3)<>INT(A4),"last",""))
Row 1 must be blank and the formula starts in row 2.

Cron Expression for Hour:Minute to Hour:Minute

I am using Cron Expressions with Quartz.NET, and having a problem generating the cron expression for a Start Hour:Minute and End Hour:Minute
If I have a Job I want to run every 5 minutes from 10:20 AM to 11:25 AM what should be the correct cron expression,
At the moment I have this: 0 20-25/5 10-11 1/1 * ? *
But this only runs at 10:20, 10:25, 11:20 and 11:25
1 Monday, June 6, 2016 11:20 AM
2 Monday, June 6, 2016 11:25 AM
3 Tuesday, June 7, 2016 10:20 AM
4 Tuesday, June 7, 2016 10:25 AM
5 Tuesday, June 7, 2016 11:20 AM
6 Tuesday, June 7, 2016 11:25 AM
7 Wednesday, June 8, 2016 10:20 AM
8 Wednesday, June 8, 2016 10:25 AM
9 Wednesday, June 8, 2016 11:20 AM
10 Wednesday, June 8, 2016 11:25 AM
But what it should do is run from 10:20 AM till 11:25 AM, every five minutes
10:20, 10:25, 10:30, 10:35, 10:40 ....... 11:20, 11:25
Quartz does exactly what you Cron expression is saying, ie every 5 minutes between minutes 20 and 25 included for hours 10 and 11. And there is no way to achieve this with one Cron expression only...
This is usually done using a trigger with daily time interval schedule (TriggerBuilder.Create().WithDailyTimeIntervalSchedule(...)) with 10:20 as daily start time, 11:25 as daily end time and with a 5 minutes interval.
If your trigger HAD TO be fired only on minutes 0 or 5, also add to the trigger a misfire instruction policy to avoid time shifting in case of recovery (See https://dzone.com/articles/quartz-scheduler-misfire)

Quartz cron trigger for every 2 weeks and 2 times a day ( 6 AM and 6PM)

I want to run a quartz job for every 2 weeks at morning 6'o clock and evening 6'o clock . how to achieve this .please advice.
I tried to schedule using below cron expression
01 01 1 1-0/14 01 ? *
but the next fire times are as below.
Sunday, January 1, 2017 1:01 AM
Sunday, January 15, 2017 1:01 AM
Sunday, January 29, 2017 1:01 AM
Monday, January 1, 2018 1:01 AM
Monday, January 15, 2018 1:01 AM
There are some kinds of date triggers cron is good at. Every N days is often not one of them. For instance, if you use something like this:
0 0 6,18 */14 * ?
You might get something like this:
Tuesday, March 29, 2016 6:00 AM
Tuesday, March 29, 2016 6:00 PM
Friday, April 1, 2016 6:00 AM
Friday, April 1, 2016 6:00 PM
Friday, April 15, 2016 6:00 AM
Friday, April 15, 2016 6:00 PM
As you can see, the 29th, followed by the 1st -- not exactly fourteen days apart.
It's useful to have something that lets you play with the expression and see the resulting dates. CronMaker can do that, if that's helpful.
However, since you say you are using Quartz, it supports other kinds of triggers, like DateIntervalTrigger that might be better suited for what you're looking for?

Resources