Day counting widget RTC

Hi.I want to make a day counter. How can I use widget rtc.
For example, how do I enter a start date and how many days have passed through blynk? do you help in code

Provide a detailed description of your coding experience.

Ok I am out of here.

I am working on an incubator. but I could not figure out how to use the widget.

RTC widget gives current time. You should convert your start date to epoch time, subtract from current date epoch and convert that resultant to number of days using the modulo function. If you are trying to find uptime, just use the Millis function.

Int days=millis()/1000/60/60%24

Some one did point out that is we use int for the counter we will get a maximum of 50 days. Using long will get you a lot more.

1 Like

I can request a sample code from void setup and void loop. When power goes, millis is reset. i know so

Take a simple sketch that works from the examples. Use the line I mentioned and print the value our using Serial.print…

This has nothing to do with Blynk except for the title which talks of RTC. If you do want to use RTC, see the RTC examples and add the line I provided.