Home > Back-end >  Small small white one, the time interval for help how to get to the value to the cron expression
Small small white one, the time interval for help how to get to the value to the cron expression

Time:09-19

Help you a great god, and how to realize the customer on the front end to select a time interval,
Background program according to the customer to choose the time perform regularly,
The main problem is how to get to the customer choice of time interval is converted into a cron expression,
Small small white one, thanked first

CodePudding user response:

Choice is to have a default value, for each preset, manual writing cron

CodePudding user response:

 String s="0"; 
String m="0";
String h="0";
H="0/5";
String format=the String. Format (" % s % s % s * *? * ", s, m, h);
System. The out. Println (format);

And second: 0-60 points: 0-60, when: 0-24
Cron interval choice, a choice only support one, such as to select the interval of every 10 minutes to 1 hour, if match into
0 0/10 0/1 * *? * is once every 10 minutes, hours of configuration has no meaning;

CodePudding user response:

This online there should be a case in point, you can search,

CodePudding user response:

Thank you, the second floor method is very good ~!
  • Related