Answers for "how to check if current time is between two date times in laravel"

PHP
0

check if date between two dates laravel

<?php 
  //check if date between two dates
$currentDate = date('Y-m-d');
$currentDate = date('Y-m-d', strtotime($currentDate));   
$startDate = date('Y-m-d', strtotime("01/09/2019"));
$endDate = date('Y-m-d', strtotime("01/10/2019"));   
if (($currentDate >= $startDate) && ($currentDate <= $endDate)){   
  echo "Current date is between two dates";
}else{    
  echo "Current date is not between two dates";  
}
//@sujay
Posted by: Guest on October-15-2020

Code answers related to "how to check if current time is between two date times in laravel"

Browse Popular Code Answers by Language