Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get day diff

$now = time(); // or your date as well
$your_date = strtotime("2010-01-31");
$datediff = $now - $your_date;

echo round($datediff / (60 * 60 * 24));
Comment

php date diff in days

$earlier = new DateTime("2010-07-06");
$later = new DateTime("2010-07-09");

$pos_diff = $earlier->diff($later)->format("%r%a"); //3
$neg_diff = $later->diff($earlier)->format("%r%a"); //-3
Comment

PREVIOUS NEXT
Code Example
Php :: checks number only in php 
Php :: how to delete image from floder in laravel 
Php :: deserialize php 
Php :: laravel check old password 
Php :: firebase jwt php verify 
Php :: how login one user with id in laravel 
Php :: rtl file manager laravel 
Php :: mySQL phpMyAdmin with Google Chrome: stuck on loading 
Php :: laravel display validation errors ajax 
Php :: php error display 
Php :: set null on foreign key deletion in laravel 
Php :: laravel route is current route 
Php :: echo post content by slug 
Php :: how to add extra days from a date php 
Php :: how to catch query exception in laravel 8 
Php :: how to concat in where clause like laravel query builder 
Php :: laravel store multiple files 
Php :: wordpress loop 
Php :: laravel dynamic page title 
Php :: carbon 2 days ago 
Php :: xdebug vscode docker 
Php :: php str_pad not working 
Php :: pegar parte da string php 
Php :: laravel form validation phone number 
Php :: wordpress get page slug 
Php :: laravel collection remove duplicates 
Php :: laravel $loop interation 
Php :: add new column to existing table laravel 
Php :: laravel if file is image 
Php :: orderby text values eliquent laravel 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =