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

Improve the examples and documentation #106

Open
rin67630 opened this issue May 5, 2020 · 6 comments
Open

Improve the examples and documentation #106

rin67630 opened this issue May 5, 2020 · 6 comments
Labels
topic: documentation Related to documentation for the project type: enhancement Proposed improvement

Comments

@rin67630
Copy link

rin67630 commented May 5, 2020

IMHO since this is this standard Arduino library for NTP, it would avoid a lot of mistakes if its functionality and limitation would be described a bit more elaborated:

It should be important to point out that this library is NOT intended to provide a full date/time functionality and will be limited to provide a time information without provision for daylight saving times, keeping the library sleek, since the overhead to compute an accurate date with respect to leap seconds is not really trivial and requires else quite a lot of resources.

On the other side, the library provides the functionality to return split numbers by seconds, minutes and hours, which is not mentioned in the given examples.

  Second  = timeClient.getSeconds();
  Minute  = timeClient.getMinutes();
  Hour    = timeClient.getHours();
  Weekday = timeClient.getDay();
  Epoch   = timeClient.getEpochTime();

That should be mentioned, since examples are limited to print a string, which means frequently a lot of lost time to find the correct method of getting the required information, which is unfortunately pretty different for each library.

I hope you could take that request into consideration.

@WhymustIhaveaname
Copy link

WhymustIhaveaname commented May 6, 2020

Leap second is a tricky thing. Apparently, this library does not provide the functionality of leap seconds correction. However, surprisingly, the time given by this library is the same as the NTP service on my Ubuntu and the standard time given by the China government. Up to now, there have been about 20 leap seconds. So if there were a leap-second problem, that must be a noticeable error that I never encounter. My opinion to leap second is, "it works, do not touch it".

As for daylight saving times, as far as I know, only Americans use it. And it is such a complicated system. I think we should cancel daylight saving times rather than add this dummy thing into every time library.

There are many other problems(and bugs) in this library and its examples. I also submit some issues and PRs(see issue101 and pull102). But no one contacts me. Some older PRs have not been merged for one or two years.

@rin67630
Copy link
Author

rin67630 commented May 7, 2020

Hmm... daylight saving time is heavily used in Europe.
But i did not require the date parts to be processed in NTPClient.
It is fine to get a sleek library to deliver time + week days without date.
I just think, it should be documented. and the examples should provide what the library can deliver.

@rin67630
Copy link
Author

rin67630 commented May 8, 2020

Finally i have written a didactic example to use NTP Client in an ESP ecosystem providing many useful variables, full date information and being Posix-compliant string/char array techniques for further use in sketches written for other libraries.
This is NOT another library!
I just used the c++ methods provided by the Espressif libraries, that comes anyway!
This is just an example to start with avoiding crippling one's code with useless/nocive libraries!
Enjoy!
https://github.com/rin67630/NaTLibESP

@WhymustIhaveaname
Copy link

daylight saving time

sorry I did not know daylight saving time is so widely used over the world.

I agree with you that this library needs a better document.

@kaynohtee
Copy link

what is the increment for time offset? at first it seems to be minutes. 60 minutes offsets the output time by an hour. 120 minutes offsets by two hours. 180 minutes three hours... BUT 240 minutes offsets by 20 hours.
Maybe an example of usage for offset time would be good.

@blaskovicz
Copy link

blaskovicz commented May 26, 2020

@kaynohtee it's epoch offset in seconds:

// use New_York epoch seconds offset
NTPClient timeClient(ntpUDP, -14400);

eg: https://www.epochconverter.com/timezones

As above mentioned though, this doesn't handle DST so it's tricky...

@per1234 per1234 added type: enhancement Proposed improvement topic: documentation Related to documentation for the project labels Mar 28, 2022
@per1234 per1234 changed the title Improve the exampes and documentation Improve the examples and documentation May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

5 participants