Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for time zones and sunrise/sunset calculation #1840

Merged
merged 3 commits into from
Sep 19, 2019

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Sep 19, 2019

Add support for time zones and sunrise/sunset calculation.

The System Clock class stores the local time and performs conversion to UTC.
This is the reverse of standard practice, and causes complications when timezones change.
This PR corrects this, and adds a port of the arduino Timezone class to provide rule-based
conversion between UTC and local times accounting for arbitrary time zones and daylight savings.

The SolarCalculator class is also included so that sunrise and sunset times can be calculated.
This is helpful for automation of lighting, for example.

The SystemClock_NTP sample has been updated to demonstrate all this.

Add `Timezone` and `SolarCalculator` classes

Modify `SystemClock_NTP` sample

- Use Timezone class for local/UTC conversions
- Show time of next sunrise/sunset to demonstrate use of SolarCalculator
@slaff slaff added this to the 4.0.0 milestone Sep 19, 2019
@slaff slaff merged commit 626caec into SmingHub:develop Sep 19, 2019
@mikee47 mikee47 deleted the feature/timezone branch September 22, 2019 12:59
@slaff slaff mentioned this pull request Sep 28, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants