JodaTime - how can I know whether a daylight saving occurs within a specified period of time?

前端 未结 3 602
感情败类
感情败类 2021-01-13 23:35

I need to know whether the period defined by:

DateTime start;
DateTime end;

has a DST inside.

I am iterating over collection of per

3条回答
  •  深忆病人
    2021-01-13 23:56

    Because Daylight Savings Time is heavily reliant on TimeZones (some areas don't practice DST, some move clocks 1 hour, some 2 etc) your time variables are going to have to account for location as well.

    As such, you might have to have a look at the DateTimeZone class

    DateTimeZone

提交回复
热议问题