java - Monthly jobs on every 30th day using Quartz -


People,

I have monthly schedules (use quartz) jobs by users I start users First date to run or run the date, it can be any day of 1-31 months My question is how is it scheduled to use the Cron trigger, keeping in mind that 31,30,29th day in all the months. In such a case, the job should be run on the last day of the first of the month. So, it says that there are only 30 days in April, so the job will be run on 30th April.

Can this single cron trigger be used? Or should it be a combination of triggers? I have tried to play with CronExpression to see how it handles such cases:

  CronExpression CE = new chronexpress ("0 030JAN-DEC? *"); Next date validTime = ce.getNextValidTimeAfter (** ** 27 February ** //);   

I got nextValidTime equal to 30 March , so any help from Kronon "left" in February will be very much appreciated. thank you in advanced.

The letter 'L' for the month of the month is allowed and the fields of the week This character & gt; For the "last", there is a short-hand, but in each of the two areas it has different meanings. For example, in the month of month, the value "l" is the "last day of the month" - 31 days of January, February For 28 days in non-leap years. If used in the area of ​​the day-to-week itself, it means only "7" or "set". But if used in the field of the week after any other value, then it means "Last Day of the Month" - for example "6L" means "Last Friday of the month". You can also specify the offset of "L-3" on the last day of the month, which will mean the third day from the third to the calendar month. When using the 'L' option, it is not important to specify a list of lists, or values, because you will get confused / unexpected results.

  new chronexpress ("0 0 l jane-dec? *");   

Edit:

I just do something like this

  calendar tCalendar = calendar paragraph (); TCalendar.set (2009, calendar. Fbery / * integer * /, 1); // For example, February 2009 - Day does not matter here if (User Selected Day) gt; TCalendar.getActualMaximum (Calendar.DAY_OF_MONTH)) // // Fix User De // Fixed = tCalendar.get Actual Maxim (calendar. DAY_OF_MONTH) //, for that month // new chronaxation ("0 0L Jane-DEC ? "); }    

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -