date转corn 定时任务获取corn

 

 /***
     * 日期转corn表达式
     * @param date 日期
     * @return
     */
    public static String getCron(Date  date){
        String dateFormat="ss mm HH dd MM ? yyyy";
        SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
        String corn = null;
        if (date != null) {
            corn = sdf.format(date);
        }
        return corn;
    }

 

相关文章:

  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
  • 2021-09-20
  • 2021-06-25
猜你喜欢
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2022-01-01
  • 2022-12-23
相关资源
相似解决方案