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<?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
Also in PHP:
- execute script php command line
- find a character in a string php
- enable php error
- How to reload a page using php
- config clear laravel
- convert timestamp to date time in php
- datetime format u
- add password php file
- convert text toupper case php
- Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 18874368 bytes) in phar:///opt/cpanel/composer/bin/composer/src/Composer/Repository/ComposerRepository.php on line 588
- date time format 12 hour am pm php
- Allowed memory size of 268435456 bytes exhausted (tried to allocate 1114112 bytes) in /var/www/docroot/core/lib/Drupal/Core/Database/Statement.php
- composer install laravel global
- catch exception of method php
- array uniuq in php
- check if object key exists in php
- clear cache laravel on server
- convert request image as base64 string php
- create random string using php
- add two numbers in php
- capitalize php
- function containsStr($str, $substr) { return strpos($str, $substr) !== false; }
- create seed laravel
- 3 letter month abbreviations in php date format