posts - 30,  comments - 50,  trackbacks - 0
1。
SimpleDateFormat tempDate = new SimpleDateFormat("yyyy-MM-dd" + " " + "hh:mm:ss");
String datetime 
= tempDate.format(new java.util.Date());

2。
Calendar now=Calendar.getInstance();
String time
=now.get(Calendar.YEAR)+"-"+(now.get(Calendar.MONTH)+1)+"-"+now.get(Calendar.DAY_OF_MONTH)+" "+now.get(Calendar.HOUR_OF_DAY)+":"+now.get(Calendar.MINUTE)+":"+now.get(Calendar.SECOND);
posted on 2007-07-31 16:22 心。 阅读(6094) 评论(3)  编辑  收藏 所属分类: java

只有注册用户登录后才能发表评论。


网站导航: