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 GXT中的时区问题?_Gwt_Gxt - Fatal编程技术网

Gwt GXT中的时区问题?

Gwt GXT中的时区问题?,gwt,gxt,Gwt,Gxt,我正在使用下面的代码 private DateField startDateField = new DateField(); Date date = new Date(); startDateField.setValue(date); Date date2 =startDateField.getValue() 问题是,当我调用startDateField.getValue()方法时,我得到的是日期,但时间设置为0。我的服务器在KOP。我以IST的身份通过日期。正如GWT根据时区调整日期一样。

我正在使用下面的代码

private DateField startDateField = new DateField();
Date date = new Date();
startDateField.setValue(date);

Date date2 =startDateField.getValue()
问题是,当我调用startDateField.getValue()方法时,我得到的是日期,但时间设置为0。我的服务器在KOP。我以IST的身份通过日期。正如GWT根据时区调整日期一样。KOP在不同的时区。如果我在IST中传递日期,那么它应该完全匹配KOP时间?请推荐我


谢谢

它可能会使用默认的语言环境(web应用程序的IST,服务器的KOP)进行转换。因此,这取决于您在哪里运行代码。但是再想想。。。在上面的例子中,这难道不能缩短时间吗?只是把它扔掉,根本没有转换。。。因为Java规范没有说明Date类的区域设置。这是由DateFormat和Calendar类处理的。