![]() ![]() SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.println(sdf.format(new Date()).toString()); //字符串 转换成日期 yyyy-MM-dd HH:mm:ss String str = "2008-10-11 12:00:00"; System.out.println(sdf.format(sdf.parse(str)).toString()); ![]() |
![]() ![]() SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.println(sdf.format(new Date()).toString()); //字符串 转换成日期 yyyy-MM-dd HH:mm:ss String str = "2008-10-11 12:00:00"; System.out.println(sdf.format(sdf.parse(str)).toString()); ![]() |