1

重複の可能性:
日付を使用して cron 式を作成するための Java クラスはありますか?

文字列連結を使用するよりも、Calendar または Date を cron 式に変換するより良い方法はありますか? お気に入り;

Calendar now = Calendar.getInstance();    
String cronExpression = now.get(Calendar.SECOND) + " " + now.get(Calendar.MINUTE) + " " + now.get(Calendar.HOUR_OF_DAY) + " " + now.get(Calendar.DAY_OF_MONTH) + " " + now.get(Calendar.MONTH) + " ? " + now.get(Calendar.YEAR);
4

0 に答える 0