Search
 
SCRIPT & CODE EXAMPLE
 

PHP

check if date between two dates laravel eloquent

//get or exist data between two dates
return Set::where('type', $type)
            ->whereDate('active_start', '<=', date("Y-m-d"))
            ->whereDate('active_end', '>=', date("Y-m-d"))
            ->first();
//@sujay
Comment

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
Comment

PREVIOUS NEXT
Code Example
Php :: how to print array in laravel blade 
Php :: check if array has value php 
Php :: wordpress order by 
Php :: php read xml from url 
Php :: sql where count greater than 
Php :: create a exporter in laravel command 
Php :: intl extension php ubuntu 
Php :: yii2 advanced nginx 
Php :: display exception in blade laravel 
Php :: how to add properties to the request object in laravel 
Php :: get file each line in php 
Php :: Load order by entity_id magento 2 
Php :: smarty shorthand assign var 
Php :: laravel group by created_at date only 
Php :: php compare strings case insensitive 
Php :: wordpress check shortcode exists 
Php :: current date in carbon 
Php :: wherebetween in laravel 
Php :: laravel date validation 
Php :: laravel migration add unique column 
Php :: laravel model quard 
Php :: laravel gmail 
Php :: transaction cakephp 2 
Php :: calcul age php datetime 
Php :: one item limit on cart in woocommerce 
Php :: get country from ip php 
Php :: acf get sub field 
Php :: php replace 
Php :: how to get the last inserted id in laravel 
Php :: strpos in python 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =