Search
 
SCRIPT & CODE EXAMPLE
 

PHP

seconds to minutes php

echo gmdate("H:i:s", 685);
Comment

seconds to days hours minutes seconds php

function seconds2human($ss) {
$s = $ss%60;
$m = floor(($ss%3600)/60);
$h = floor(($ss%86400)/3600);
$d = floor(($ss%2592000)/86400);
$M = floor($ss/2592000);

return "$M months, $d days, $h hours, $m minutes, $s seconds";
}
Comment

php date to seconds

<?php
$str = 'Tue Dec 15 2009';
$timestamp = strtotime($str);
echo $timestamp;
//output: 1260831600
?>
Comment

add seconds to datetime php

<?php 
$date = new DateTime();
echo $date->getTimestamp(). "<br>";
$date->add(new DateInterval('PT674165S')); // adds 674165 secs
echo $date->getTimestamp();
?>
Comment

hours to seconds php

$str_time = "2:50";

sscanf($str_time, "%d:%d:%d", $hours, $minutes, $seconds);

$time_seconds = isset($seconds) ? $hours * 3600 + $minutes * 60 + $seconds : $hours * 60 + $minutes;
Comment

PREVIOUS NEXT
Code Example
Php :: explode function in laravel 
Php :: array_map class method 
Php :: php remove 1 day from date 
Php :: WP Uploads Media Path 
Php :: how to write for loop in laravel blade 
Php :: get first element of array php 
Php :: route not defined. laravel 9 
Php :: Carbon Add Months To Date In Laravel 
Php :: php search in object. array 
Php :: How to create an array from a CSV file using PHP 
Php :: php in array 
Php :: laravel blade auth user 
Php :: php quit 
Php :: php get extension from file from form submit 
Php :: php mkdir recursive 
Php :: twig ternary 
Php :: using laravel back function on blade 
Php :: form validation with larvel api 
Php :: replace all numbers in string php 
Php :: php post 
Php :: get theme path wordpress dev 
Php :: woocommerce get post terms product 
Php :: laravellivewire is not defined 
Php :: is users logged in laravel blade 
Php :: Laravel validating birthdate by 13 years old 
Php :: php include files 
Php :: php shell script 
Php :: laravel custom 404 blade 
Php :: check if user has role twig 
Php :: getting last day of next month in php 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =