Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
String year = String.valueOf(calendar.get(Calendar.YEAR));
String month = String.valueOf(calendar.get(Calendar.MONTH)+1);
String day = String.valueOf(calendar.get(Calendar.DATE));
String hour = String.valueOf(calendar.get(Calendar.HOUR));
String minute = String.valueOf(calendar.get(Calendar.MINUTE));
String second = String.valueOf(calendar.get(Calendar.SECOND));
System.out.println(year+month+day+hour+minute+second);
posted on 2009-05-31 20:53
kelly 阅读(994)
评论(0) 编辑 收藏 所属分类:
java