简体   繁体   中英

uk time zone format for the day light saving

I am using GMT+1 for uk time zone in my code. My problem is for daylight saving it will not work. Can i use BST in place of that so that it will automatically take care of the daylight saving.

No, you should use the time zone identifier of "Europe/London" as that is the time zone observed by the UK. It should then be accurate for both standard time and daylight saving time.

(As a general note, if you're doing any significant date and time work in Java, it's worth checking out Joda Time - a much nicer API than the built-in one.)

断言TimeZone.getTimeZone(“ BST”)。getDisplayName()。equals(“孟加拉国时间”);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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