Schedule in PHP: Operations with datetime

How to work with days and hours in PHP?

To work with dates and hours we are going to draw a schedule with entries every 30 minutes.

The solution:

Captura de pantalla 2017-02-21 a las 11.29.41

Here is the code, I promise I am going to explain it soon 😛