开发者

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 wor开发者_StackOverflow社区k. 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.)


assert TimeZone.getTimeZone("BST").getDisplayName().equals("Bangladesh Time");

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜