3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php print_r(verifyDate('1.1.2011')); echo ':::'; print_r(getMonth(null)); echo ':::'; print_r(getQuarter(null)); echo ':::'; print_r(dtf(' ')); function getMonth($d) { return dtf($d,'n'); } function getQuarter($d) { return ceil( getMonth($d) / 3); } function verifyDate($date) { return DateTime::createFromFormat('m/d/Y', $date); } function dtf($date, $format = 'd.m.Y'){ if($date){ $date = new DateTime($date); return $date->format($format); } }
based on QmCpR