Search
 
SCRIPT & CODE EXAMPLE
 

PHP

substract two datetime and get the different hours and minutes php

$time1 = new DateTime('2022-05-05 11:54:48');
$time2 = new DateTime('2022-05-05 12:00:48');
$diff = $time2->diff($time1);
$time_spent = $diff->format("%H:%I:%S");
echo $time_spent;
//Jerespy
Comment

PREVIOUS NEXT
Code Example
Php :: php sort() 
Php :: laravel undefined index 
Php :: laravel auth setup 
Php :: how to make core controller codeigniter 3 more than 1 
Php :: throw 403 laravel 
Php :: fillable property to allow mass assignment 
Php :: print in file php 
Php :: wordpress enqueue js 
Php :: {{count laravel 
Php :: laravel blade @auth 
Php :: php substr 
Php :: php undefined index meaNING 
Php :: if exists in string count php 
Php :: laravel model 
Php :: Advanced Custom Fields get sub field image 
Php :: symfony messenger routing 
Php :: update checkbox value in laravel 
Php :: php functions parameters 
Php :: wordpress change post format 
Php :: get admin url wordpress 
Php :: withsuccess laravel 8 
Php :: configuration laravel dompdf 
Php :: laravel s3 download file 
Php :: php json_encode indent 
Php :: laravel 8 validation unique 2 columns 
Php :: jsondecode php array 
Php :: php null coalesce 
Php :: laravel array in lang 
Php :: php call method from another class 
Php :: laravel debugbar false 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =