GWT的DateUtil使用
我应用的是 smartgwt-3.1.jar
DateUtil 使用catalina.jar
字符段转换
Date date2 = DateUtil.parseInput("11/01/2011"); System.out.println(date2);
输出 Tue Nov 01 00:00:00 CST 2011
时间转换成字符
Date date1 =startDateItem.getValueAsDate(); String dateStr =DateUtil.formatAsShortDatetime(date1); System.out.println(dateStr);
输出:2013-07-04 06:00
DateUtil.setNormalDateDisplayFormatter(new DateDisplayFormatter() { public String format(Date date) { if(date == null) return null; final DateTimeFormat dateFormatter = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss"); String format = dateFormatter.format(date); return format; } }); dateStr =DateUtil.formatAsNormalDate(date1); System.out.println(dateStr);
输出: 2013-07-04 06:00:00
相关推荐
89384099 2012-08-22
84487906 2011-10-13
orangesdk 2012-01-12
84487906 2012-01-12
JimmyblyLee 2012-01-12
89384099 2012-01-12
shangsoft 2012-01-12
84487906 2014-08-17
JimmyblyLee 2016-08-10
84487906 2012-01-12
shangsoft 2011-10-22
orangesdk 2011-03-23
XuDTone 2011-03-22
JimmyblyLee 2011-01-07
heimeiyingwang 2010-08-12
84487906 2010-08-12
netHibernate 2010-03-28