Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GWT:dateformat';2013年10月2日星期三00:00:00 CEST&x27-&燃气轮机';2013-10-02';_Gwt - Fatal编程技术网

GWT:dateformat';2013年10月2日星期三00:00:00 CEST&x27-&燃气轮机';2013-10-02';

GWT:dateformat';2013年10月2日星期三00:00:00 CEST&x27-&燃气轮机';2013-10-02';,gwt,Gwt,在过去的几个小时里,我尝试了很多方法,但似乎没有一种有效。每次输出都与输入格式相同(“2013年10月2日星期三00:00:00 CEST”) 如果有人能给出如何实现这一点的示例代码,我将不胜感激 谢谢 DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat("yyyy-MM-dd"); String formattedDate = dateTimeFormat.format(new Date()); // "2013-1

在过去的几个小时里,我尝试了很多方法,但似乎没有一种有效。每次输出都与输入格式相同(“2013年10月2日星期三00:00:00 CEST”)

如果有人能给出如何实现这一点的示例代码,我将不胜感激

谢谢

    DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat("yyyy-MM-dd");
    String formattedDate = dateTimeFormat.format(new Date()); // "2013-10-03"

您可以查看
DateTimeFormat
的信息,其中包括有关如何格式化/解析日期和时间的示例、模式等

你能发布你已经尝试过的东西吗?你能展示一个你已经尝试过的代码的例子吗?这样我们可以帮助你找出错误所在吗?
DateTimeFormat.getFormat( "yyyy-MM-dd").format(new Date());