org.joda.time | Day Light Saving time (DST) and local time zone offset

前端 未结 3 1864
星月不相逢
星月不相逢 2020-12-18 06:14

just to verify this: I have this lame and brain dead method to calculate the time zone offset for my current location. I wonder if I need to adjust it when Day Light Saving

3条回答
  •  悲&欢浪女
    2020-12-18 06:38

    Yes, that's fine. To verify that it is correct - instead of passing null pass in a DateTime object to DateTimeZone.getOffset - set the datetime to sometime in summer when you know DST is in effect - you should see the offset value change.

提交回复
热议问题