Skip to content

Eliminate need for multiple calls to nondeterministic millis() when getting individual day/time components#141

Open
LeonPoon wants to merge 1 commit into
arduino-libraries:masterfrom
LeonPoon:master
Open

Eliminate need for multiple calls to nondeterministic millis() when getting individual day/time components#141
LeonPoon wants to merge 1 commit into
arduino-libraries:masterfrom
LeonPoon:master

Conversation

@LeonPoon

@LeonPoon LeonPoon commented May 19, 2021

Copy link
Copy Markdown

Also eliminated some dup calc code between getHours/Minutes/Seconds and getFormattedTime.

Fully backwards compatible.

@CLAassistant

CLAassistant commented May 19, 2021

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@LeonPoon LeonPoon changed the title Eliminate need for multiple calls to nondeterministic millis() when getFormattedTime() Eliminate need for multiple calls to nondeterministic millis() when getting individual day/time components May 19, 2021
@LeonPoon

LeonPoon commented Jun 2, 2021

Copy link
Copy Markdown
Author

Would appreciate feedback, or a merge please.

I encountered one instance when the getHours and getMinutes don't provide consistent results, because of each of these make calls to millis() on their own, which might not return the same value. It was 8:59++ and getHours() returned 8 but getMinutes returned 0 and my datalogger recorded time as 8:00 when it was actually closer to 9:00.

With this patch, allows me to provide same millis input to gethours/minutes rather than having these get functions call their own millis().

thanks.

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