Cronos icon indicating copy to clipboard operation
Cronos copied to clipboard

Fortnight how to run a Job every Fortnight , It's every second SAT. or /14 days.

Open georgioua opened this issue 2 years ago • 7 comments

Fortnight how to run a Job every Fortnight , It's every second SAT. or /14 days.

georgioua avatar Dec 05 '23 02:12 georgioua

This 0 0 * * 6#2 should work, reference: https://github.com/HangfireIO/Cronos#cron-format

aravind-alapati avatar Dec 11 '23 04:12 aravind-alapati

6=SAT Is SUN=0 or 7? MON=1 ?

georgioua avatar Jan 09 '24 00:01 georgioua

Both 0 and 7 means SUN and MON =1

image

aravind-alapati avatar Jan 09 '24 04:01 aravind-alapati

This is not fortnight still. It's every second Saturday of the month.

georgioua avatar Feb 19 '24 01:02 georgioua

Isn't it what you asked for ? image

aravind-alapati avatar Feb 19 '24 02:02 aravind-alapati

Have the same problem here. I want to run a job every second friday. The Cron expression "0 0 * * 5#2,5#4" will run every other Friday, that is, the second and fourth Friday of each month. Starting from today (May 3, 2024), the next runs in 2024 will be: May: 10th (2nd Friday) and 24th (4th Friday) June: 14th (2nd Friday) and 28th (4th Friday) July: 12th (2nd Friday) and 26th (4th Friday) August: 9th (2nd Friday) and 23rd (4th Friday)

The problem here is that there is not every second friday: May: 10th and 24th June: 7th and 21th July: 5th and 19th August: 2th, 16th and 30th.

May is OK, but from June... not OK.

So, the feature request here is a kind of "skip". Ex: skip 0 means every occation, skip 1 means that you skip one occation, skip 2 means that you skip two occation etc. This means that you need a "fromDate" or something to indicate start of the first occation.

This would be very helpful! Thanks!

christianhsmebye avatar May 07 '24 10:05 christianhsmebye