You just need to view this from the most basic mathematical side of things.
When you retrieve Time.local()
you get a big number that represents the count of seconds since 01/01/1970 00:00:00.
One day has 86400 seconds. So when you divide that big number by 86400 you will get the number of days since then as the integer value and the remainder will give you the amount of seconds the current day is old.
So if you want to represent any arbitrary time (e.g. 11:25:30 am) you can calculate that time as
int secondOfDay = 11*60*60 + 25*60 + 30;
And if you want to sleep from now till then, you’d write
int currentSecond = Time.local() % 86400;
int tomorrow = 86400 + secondOfDay;
int secondsToSleep = tomorrow - currentSecond;
System.sleep(SLEEP_MODE_DEEP, secondsToSleep);
This will take care of waking every day at the same time.
What you want to do when you are awake is another business.
You could do something like this (or anything else )
switch(Time.day())
{
case 1:
// do things on Sunday
break;
case 2:
// do things on Monday
break;
default:
// do nothing the rest of the days
}