基于DateFormatUtils类对Date对象做格式化

    xiaoxiao2021-03-25  144

    public class Test { public static void main(String[] args) { Log logger = LogFactory.getLog(Test.class); String str = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"); logger.info(str); } }

    备注:依赖jar包commoms-lang-2.4.jar

    转载请注明原文地址: https://ju.6miu.com/read-8899.html

    最新回复(0)