Calculating daylight saving time from only date

后端 未结 9 1595
春和景丽
春和景丽 2021-01-31 10:53

I am working with an Arduino and a real time clock chip. The chip compensates for leap years and such, so it will always have the correct date, but it does not handle daylight s

9条回答
  •  孤独总比滥情好
    2021-01-31 11:07

    I am trying with this approach and I think it simple and accurate:

    // for first Sunday of March as if DoW = 1 for Sunday if (month==3 && day>=8 && day <=14 && DoW=1) return True

    // for second Sunday of Nov as if DoW = 1 for Sunday if (month==11 && day>=1 && day <=7 && DoW=1) return True

提交回复
热议问题