gpt4 book ai didi

java - java.text.SimpleDateFormat : GWT Compilation Error 类型没有可用的源代码

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:01:09 25 4
gpt4 key购买 nike

我试图制作一个 GWT 应用程序。然后我在客户端和共享端中使用 SimpleDateFormat 类时遇到了一些错误。

[ERROR] [gwtfirst] Line 381: No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module?

以下是我在客户端的代码:

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
Window.alert(sdf.format(usersList.get(30).getCreatedate()));

但是我可以在服务器端使用 SimpleDateFormat...我想知道我是否不能在客户端或共享端使用 SimpleDateFormat?

最佳答案

SimpleDateFormat 在 GWT 中不可用。使用 com.google.gwt.i18n.client.DateTimeFormat相反。

关于java - java.text.SimpleDateFormat : GWT Compilation Error 类型没有可用的源代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18139457/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com