Subscribe to Arduino Academy and start learning today for FREE!

Calculate Daylight Savings Time Date

The web based apps I write often have informative messages for the users, and one request was a reminder to change the clocks for Daylight Savings Time. Since it’s not the same date each year, but is always the Second Sunday of March and the First Sunday of November, I needed to be able to get a date for those days. It’s fairly easy in PHP, as you can see below.

 


$year = date('Y');
$spring = date('m-d-Y 02:00:00 A', 
strtotime('Second Sunday Of March '.$year));
$fall = date('m-d-Y 02:00:00 A', 
strtotime('First Sunday Of November '.$year));

echo ‘Spring: ‘ . $spring;

Become the Maker you were born to be. Try Arduino Academy for FREE!

echo ‘Fall: ‘ . $fall;

 

Here is the quiz of the day:

How would you accomplish this on the Arduino?

Reference:

Arduino Time Libraries

Arduino DST Solution

Become the Maker you were born to be. Try Arduino Academy for FREE!

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Archives

0
Would love your thoughts, please comment.x
()
x