is possible generate datatime with loop for or foreach with 30 minutes intervals?
for example:
for($i=0;$i<?;$i ??){
echo ;
}
now is 2011-12-18 02:24:00
and i would like receive:
2011-12-18 02:00:00
2011-12-18 02:54:00
2011-12-18 03:24:00
2011-12-18 03:54:00
2011-12-18 04:24:00
2011-12-18 04:54:00
2011-12-18 05:24:00
You can use PHP’s DateTime for this:
Demo