I want to check current times is greater than 12.00 pm
or not in PHP
I have tried this code
<?php
date_default_timezone_set('Asia/Kolkata');
$currentTime = date( 'h:i:s A', time () );
echo $currentTime;
//var_dump($currentTime);
$tm="12:00:00 PM";
$from= date("h:i:s A", strtotime($tm));
echo $from;
//var_dump($from);
if($currentTime>$from){
echo "success";
}
?>
but it is comparing times as string. If the current time is 2.00pm
it is not printing success.