I'm working on my home automation code and wonder what the best way to do calculations involving date/time.

One of my HA is to press a button which turns on my garden path lights for 5 minutes and then turns them off.

At first I thought of taking the current time adding 5 minutes, then testing to see when 5 minutes have past and turn them off. But then I realized if I turn the lights on after 55 minutes past the hour I would have to do hour math. And if it' just before midnight day hour math.

Easiest solution would be if Arduino have a command to convert year, month, day, hour minutes to an integer. Then I could just do integer math.

Anyone know if such a command exists? And what it is? Or is there a better way?

Thanks