企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
#### DateFormat ``` 由于DateFormat为抽象类,不能直接使用,所以需要常用的子类`java.text.SimpleDateFormat` ``` #### format ``` DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String format = dateFormat.format(new Date()); System.out.println(format); 2019-04-22 16:25:50 ``` #### parse ``` DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = dateFormat.parse("2019-04-22 16:24:38"); System.out.println(date); Mon Apr 22 16:24:38 CST 2019 ```