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 :: Installing PHP and Configuring Nginx to Use the PHP Processor 
Php :: php group array by value and count 
Php :: how to rename uploaded file in codeigniter before upload 
Php :: php calculate hours and minutes between two times 
Php :: laravel query builder select first 
Php :: factory laravel 
Php :: how to take last entry in database in laravel Method Two 
Php :: laravel create or update eloquesnt 
Php :: ternary operator for three conditions in php 
Php :: php artisan orderByDesc 
Php :: how to insert multiple selected checkbox values in database in php 
Php :: Command for single migration in larvel 
Php :: laravel pagination keep query string 
Php :: php Convert String containing commas to array 
Php :: emergency password reset script wordpress 
Php :: if condition view page of laravel 
Php :: laravel execute command from terminal 
Php :: laravel mutators 
Php :: env value return null laravel 
Php :: sum of multidimensional array in php 
Php :: contains php 
Php :: laravel collection remove empty 
Php :: settimezone in php 
Php :: Update Query in Codeigniter Using Multiple Where Condition 
Php :: laravel validation image or file 
Php :: php string nach zeichen zerlegen 
Php :: add text next to price woocommerce 
Php :: php recaptcha 
Php :: call to a member function setcookie() on null laravel middleware 
Php :: laravel Service Unavailable 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =