Public snipts »
hongster's
snipts » strtotime
showing 1-2 of 2 snipts for strtotime
-
∞ Determine the earliest business day, taking business hour into consideration.
<?php function next_business_date() { $min = time(); // Past cut-off time, make it the next day. if (date('H', $min) >= '17') { $min += 86400; // +24 Hours } // If it falls on weekend, make it Monday. $day_of_week = date('N', $min); if ($day_of_week == '6') { $min += 172800; } elseif ($day_of_week == '7') { $min += 86400; } return strtotime(date('Y-m-d', $min)); } ?>
-
∞ Convert input to MySQL datetime.
<?php date('Y-m-d H:i:s', strtotime($_POST['birthday'])); ?>



Pro JavaScript Techniques