java

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.


Solution

  • 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.)