---
title: "Gwt Client DateFormat"
author: "bean-woo"
date: "2012-08-10T10:21:52Z"
tags: []
categories: ["Web前端"]
slug: "gwt-client-dateformat"
draft: false
lastmod: "2012-08-10T10:21:52Z"
id: 1627903
url: "https://smartgwt.iteye.com/blog/1627903"
---

1\. 继承模块

在XX.gwt.xml中引入：

 

    **&lt;inherits** name="com.google.gwt.i18n.I18N"**/&gt;**  

 

2\. 在代码中使用：

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

 

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