How to make an alarm clock

Hello,

I’m fairly new to programming with Arduino and i walk in to an problem.
I want to create a alarm clock by setting the current time + 5 minutes. As long as that exception is true, an output stays high. The alarm clock must be set when a push button is pushed. My idea of coding this:

time_t stoptime = DateTime.now() + 5
(that 5 is the 5 minutes the exception stays true)
if (DateTime.now() < stoptime)
{
do this
}
else
{
do this
}

Please help meee!!

How does your arduino know what the time is? Is it always five minutes? How is DateTime implemented?

That's my question; i want to count 5 minutes on top of the current time, so that makes an stoptime. And when the stoptime reached, all vars must be reset.

5 (minutes) * 60 (seconds) * 1000 (milliseconds per second) = 300000UL.