可能重复:
Is there a java class for constructing a cron expression using a date?
有没有比使用字符串连接更好的方法将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);