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

RTC doesn't account for daylight savings #123

Closed
BGoto808 opened this issue Sep 8, 2020 · 3 comments
Closed

RTC doesn't account for daylight savings #123

BGoto808 opened this issue Sep 8, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@BGoto808
Copy link
Contributor

BGoto808 commented Sep 8, 2020

Describe the bug
The RTC conversion readings from local to UTC time does not account for daylight savings resulting in the time readings to be off by up to 1 hour depending on the time of year and time zone.

Hardware in Use
Any hardware with an RTC (Hypnos, DS3231, PCF8523, etc.) and a Feather M0

To Reproduce
Steps to reproduce the behavior:

  1. Use Hypnos_SD example code
  2. Change config.h to use local time as PDT and use_utc_time to be true (10, true)
  3. Upload code to Feather

Expected behavior
The time readings to accurately convert from local time to UTC time

Code
Look at Hypnos_SD example code.

Config
"{
'general':
{
'name':'Device',
'instance':1,
'interval':5000,
'print_verbosity':2
},
'components':[
{
'name':'Analog',
'params':'default'
},
{
'name':'SD',
'params': 'default'
},
{
'name':'DS3231',
'params':[10, true]
}
]
}"

Additional context
Daylight savings time zones should have different conversions than the standard local time zone.

@BGoto808 BGoto808 added the bug Something isn't working label Sep 8, 2020
MrKangs added a commit that referenced this issue Sep 8, 2020
@MrKangs MrKangs self-assigned this Sep 8, 2020
@MrKangs
Copy link
Contributor

MrKangs commented Sep 8, 2020

There were some false readings in some time zone. I fixed that part so that it will be better. The user needs to update as daylight saving happens. This will be pushed into the code to master soon.

@MrKangs MrKangs closed this as completed Sep 8, 2020
@MrKangs MrKangs reopened this Sep 9, 2020
@MrKangs
Copy link
Contributor

MrKangs commented Sep 9, 2020

We are planning to change for a checker rather than a user that needs to change in the config file. Reference can be found here.
Also, we are planning that no matter user wants, UTC will be printed out rather than the local time zone. This will be updated soon.

@MrKangs MrKangs added enhancement New feature or request and removed bug Something isn't working labels Sep 15, 2020
MrKangs added a commit that referenced this issue Sep 15, 2020
@MrKangs
Copy link
Contributor

MrKangs commented Sep 15, 2020

Now it has a checker feature that it will automatically switch standard time to daylight saving/ summer time when it happens on the day that it suppose to change. At the same time, we remove some time zone since they are not used anymore or incorrect names for that time zone. Last, for now on, the RTC will read UTC as default. Therefore, if you want to read your local time rather than UTC, then set the params as true in the second parameter. This code will be merged into master soon. If you need this feature/ bug fix, then please use the RTC branch for now.

@MrKangs MrKangs closed this as completed Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants