I have created an app which is connencted to my arduino via bluetoth. The user of the app can turn on and off a led which is connented to the arduino. But I want to take it a step further... I want the user to be able to give the time and the date when the light should turn on and additionally the time that sould pass until the led turns off again. Is it significantly harder? I have thought of using an already existing alarm app but I am pretty stuck, so could anyone give me some suggestions?
Make the Bluetooth message send how many seconds it is until the light should be on, and how many seconds it should stay on.
Then the arduino code can just handle everything with millis(). You know the millis() you were asked to start, add the delay, and wait for that time.
Delays less than 50 days (wrap around of millis ()) take no effort to handle it you embrace the overflow.
Handling delays greater than 50 days can be achieved by watching for millis() overflows and counting them. You could also make your own timer based counter.
If you care about recovery after power loss / reset you could use an RTC module. Depending on its complexity, it could interrupt you or you poll it to check for a date you saved to Arduino eeprom. You would have to consider what the system should do it the alarm would have happened during the power loss...