首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

GWT 中日期格式化 ,处置Date

2012-09-20 
GWT 中日期格式化 ,处理Date?1. 继承模块在XX.gwt.xml中引入:???? inherits?namecom.google.gwt.i18n.I

GWT 中日期格式化 ,处理Date

?

1. 继承模块

在XX.gwt.xml中引入:

?

??? <inherits?name="com.google.gwt.i18n.I18N"/>??

?

2. 在代码中使用:

import?com.google.gwt.i18n.client.DateTimeFormat;???

?

?

?

?

?

在client 中使用SimpleDateFormat经常出现这个错误:

No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module?

?

解决办法在上面。

DateTimeFormat?format?=?DateTimeFormat.getFormat("yyyy-MM-dd");??

热点排行