Giter Club home page Giter Club logo

Comments (4)

blackketter avatar blackketter commented on August 26, 2024

That example is instructive, but check out https://github.com/arduino-libraries/NTPClient

I'm using that with the following code:

WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP);

time_t ntpSyncProvider() {
  return timeClient.getEpochTime();
}

and then in setup():

  timeClient.begin();
  timeClient.setTimeOffset(timeZoneOffset);

  setSyncProvider(&ntpSyncProvider);
  setSyncInterval(5);

and in loop():

  timeClient.update();

from time.

arlaor avatar arlaor commented on August 26, 2024

Hi @blackketter in the related example I not find the parameters used for the hours, minutes and seconds, everything happens outside the code.
I want to use the example for my project that is turn on at certain days, every hour of the day, a relay and keep it on for a few minutes. So I need to manipulate the variables of time to do, but they do not appear in the code example.
I have reviewed the library NTPClient.h but neither appear.

from time.

blackketter avatar blackketter commented on August 26, 2024

If you use my sample code above you can have the Time library use the NTPClient to synchronize the time and then the Time library functions to figure out what day or time it is now.

Beyond this, your question isn't really a bug for the Time library and so should be asked in another forum somewhere.

from time.

arlaor avatar arlaor commented on August 26, 2024

unfortunately I could not make timelib.h or time.h library assume the values of year month day hour minutes seconds.
forgiveness for having overlooked the forum rules.
I appreciate your cooperation.
I tried to follow some other example that fits my needs

from time.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.