GXT 中的时区问题?

发布于 2024-12-26 02:08:48 字数 364 浏览 1 评论 0原文

我正在使用下面的代码。

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 时间?请建议我。

谢谢!

I am using below code.

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

Date date2 =startDateField.getValue()

The problem is, when i call startDateField.getValue() method i am getting date but time is set 0. my server is in KOP. i am passing date as IST. as GWT does adjustments of dates based on timezone. KOP is in different timezone. if i pass date in IST then it should take exactly matching KOP time? Please suggest me.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文