Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php inline if condition date time

<?php 
     $deliverytime = new DateTime('2014-09-08 06:00:00');
     $hour = $deliverytime->format('H');
     if ($hour < 12) {
       echo "Morning";
     } else {
       echo "Afternoon or evening";
     }
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #inline #condition #date #time
ADD COMMENT
Topic
Name
8+9 =