'How to generate a random date executing code reaching the date? [closed]

I am looking for how to generate a random date with hours and minutes and when the real time reaches that date, execute a php code.

I was thinking of doing it with an infinite loop but I don't know if it's the best option.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source