Sun Apr 16 00:00:00 CST 2023 format conversion

        Date date = new Date();
        log.info("The current time is:{}",date);
                                                    //yyyy-MM-dd HH:mm:ss
        SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.YYYY_MM_DD_HH_MM_SS);
        String dateTime = sdf.format(date);
        Date date3 = DateUtil.parse(dateTime );
 
        String now = DateUtil.now();
        log.info("The current time is: {}",now);

 

Guess you like

Origin blog.csdn.net/wufaqidong1/article/details/130365938