Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get hours difference between two dates in php

$hourdiff = round((strtotime($time1) - strtotime($time2))/3600, 1);
Comment

php time difference in hours

	date_default_timezone_set("Africa/Johannesburg");
    $now = new DateTime();
    $future_date = new DateTime('2020-10-21 00:00:00');
    
    $interval = $future_date->diff($now);
    
    echo ($interval->format("%a") * 24) + $interval->format("%h"). " hours". $interval->format(" %i minutes ");
    print_r($now->format('Y-m-d H:i:s'));
Comment

php calculate hours and minutes between two times

date_default_timezone_set("Africa/Johannesburg");
    $now = new DateTime();
    $future_date = new DateTime('2020-10-21 00:00:00');
    
    $interval = $future_date->diff($now);
    
    echo ($interval->format("%a") * 24) + $interval->format("%h"). " hours". $interval->format(" %i minutes ");
    print_r($now->format('Y-m-d H:i:s'));
Comment

PREVIOUS NEXT
Code Example
Php :: php get post json data 
Php :: add foreign key in laravel migration 
Php :: ternary expressions php 
Php :: woocommerce add to cart hook 
Php :: use multiple pagination in same page laravel 
Php :: AUTO_INCREMENT in laravel 
Php :: php convert string to chars 
Php :: laravel upgrade php version 
Php :: laravel where multiple conditions on single colmn 
Php :: multiple selected checkbox values in database 
Php :: Command for single migration in larvel 
Php :: PHP utf8_encode — Converts a string from ISO-8859-1 to UTF-8 
Php :: illuminate/container requires php your php version (X.X.XX) does not satisfy that requirement. 
Php :: get csv file from server folder in PHP 
Php :: laravel form request custom error message 
Php :: if browser url is having domain name in it check using php 
Php :: date diff in laravel 
Php :: php sort custom function 
Php :: login form in php 
Php :: laravel pluck relationship 
Php :: laravel db raw query execute 
Php :: php ternary shorthand 
Php :: php cookie 
Php :: how to install symfony in windows 10 
Php :: belongs to many laravel 
Php :: send email in php 
Php :: check laravel first null 
Php :: what is better, php or javascript 
Php :: php remove control characters from string 
Php :: add custom attribute for validation errors laravel 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =