Arduino Clock: Setting Time

thnx a lot!!!

the code is now working!!

here it is:

time_t alarmOnTime = (10 * SECS_PER_HOUR) + (41 * SECS_PER_MIN);
time_t alarmOffTime = (10 * SECS_PER_HOUR) + (42 * SECS_PER_MIN);
//time_t alarmOffTime = alarmOnTime + (30 * SECS_PER_SEC);
time_t nextAlarmOff;
time_t nextAlarmOn;

nextAlarmOn = previousMidnight(DateTime.now())+ alarmOnTime;
nextAlarmOff = previousMidnight(DateTime.now())+ alarmOffTime;

if ( DateTime.now() >= nextAlarmOn && DateTime.now() < nextAlarmOff){
digitalWrite(ledPin, HIGH);
}
else
{
digitalWrite(ledPin, LOW);
}
}
}

now I'm curious to set exact seconds to turn of, not minutes, something like
time_t alarmOffTime = alarmOnTime + (30 * SECS_PER_SEC);
but SECS_PER_SEC don't exist

and also I'll need to slowly start led...

PaulS, you saved me :slight_smile: