public static void main(String[] args) { LocalDateTime local = LocalDateTime.now(); Date date = new Date(); //Date 类型的时间使用SimpleDateFormat SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.println(sdf.format(date));…
http://blog.progs.be/542/date-to-java-time Java8 has new date and time classes to “replace” the old not-so-beloved java.util.Date class. Unfortunately though, converting between the two is somewhat less obvious than you might expect. Convert java.uti…