GData TimeZoneProperty 到 Java TimeZone

发布于 2024-11-05 09:29:06 字数 333 浏览 9 评论 0原文

有谁知道我如何解析 google.gdata.calendar.TimeZonePropertyjava.util.TimeZone

提前致谢。

米基万。

Does anybody know how can I parse a google.gdata.calendar.TimeZoneProperty to a java.util.TimeZone?.

Thanks in advance.

Mikywan.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羁〃客ぐ 2024-11-12 09:29:06

事实证明,将 GData 的 TimeZoneProperty 解析为 java.TimeZone 非常简单。

我把解决这个问题的代码留给你。

享受!

米基万。

public static TimeZone parse(TimeZoneProperty pTimeZoneProperty) {
    TimeZone timeZoneRet = null;    

    if (pTimeZoneProperty != null && pTimeZoneProperty.getValue() != null && !pTimeZoneProperty.getValue().isEmpty()) {
        timeZoneRet = TimeZone.getTimeZone(pTimeZoneProperty.getValue());
    }

    return timeZoneRet;
}

As it turns out, it's quite simple to parse GData's TimeZoneProperty to java.TimeZone.

I leave you the code that solves it.

Enjoy!

Mikywan.

public static TimeZone parse(TimeZoneProperty pTimeZoneProperty) {
    TimeZone timeZoneRet = null;    

    if (pTimeZoneProperty != null && pTimeZoneProperty.getValue() != null && !pTimeZoneProperty.getValue().isEmpty()) {
        timeZoneRet = TimeZone.getTimeZone(pTimeZoneProperty.getValue());
    }

    return timeZoneRet;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文