简体   繁体   English

Java中夏令时的时区问题

[英]Time zone issue with day light saving in java

In my web application I am using Google calendar . 在我的Web应用程序中,我正在使用Google日历 Due to day light savings issue day light savings time is added when I saved the events in Google calendar through my application. 由于夏令时问题,当我通过应用程序将事件保存在Google日历中时,便增加了夏令时。

My application uses Java 1.6 and Google calendar v3 . 我的应用程序使用Java 1.6Google Calendar v3

What is the best solution to handle every time zone in the world? 处理世界上每个时区的最佳解决方案是什么?

You may use SimpleDateFormat class as stated here before Java8 您可以在Java8之前使用此处所述的SimpleDateFormat

or may use ZonedDateTime in Java 8 as mentioned here 或者可以提到在Java中使用8 ZonedDateTime 这里

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM