SimplDateFormat 日期格式转换

SimpleDateFormat now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar c = Calendar.getInstance();
System.out.println("insertTime--->"+now.format(c.getTime()));

SimpleDateFormat now = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");
yyyy-mm-dd如果写成小写的"mm"则指的是分钟,大写才是月

posted @ 2012-01-04 00:19  Atlas's blog  阅读(266)  评论(0编辑  收藏  举报