3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $endDate = strtotime('2015-03-30 12:01:00'); $endDate = -$endDate % 1800; $endDate = date('Y-m-d H:i:s', $endDate); $startDate = date('Y-m-d H:i:s', strtotime($endDate . " - 1800 seconds")); echo $startDate; echo $endDate;
based on OD4rb
Output for 5.1.2 - 7.2.0
1970-01-01 00:29:001970-01-01 00:59:00
Output for 5.1.0 - 5.1.1
1970-01-01 01:00:001970-01-01 00:59:00
Output for 4.3.0 - 5.0.5
1970-01-01 01:29:001970-01-01 00:59:00