Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to add hour minute seconds in php datetime

date('Y-m-d H:i',strtotime('+1 hour +20 minutes',strtotime($start)));
Comment

php datetime add one hour

$date = new DateTime('2006-12-12 15:00');
$date->modify('+1 hour');
echo $date->format('Y-m-d');	// 2006-12-12 16:00
Comment

add hour minute in datetime in php

$minutes_to_add = 5;

$time = new DateTime('2011-11-17 05:05');
$time->add(new DateInterval('PT' . $minutes_to_add . 'M'));

$stamp = $time->format('Y-m-d H:i');
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

PREVIOUS NEXT
Code Example
Php :: php get location from ip address 
Php :: why css not working with php file 
Php :: how to get javascript variable value in php 
Php :: ubuntu 20 phpmyadmin install 
Php :: How to show php text 
Php :: create session in wordpress 
Php :: php round all values in array 
Php :: setup_postdata not working 
Php :: php set selected option 
Php :: php time how long a function takes 
Php :: decode jwt token laravel 
Php :: php redirect if not logged in 
Php :: logout in laravel 8 
Php :: how to print array in laravel blade 
Php :: get page name wp 
Php :: convert date in php 
Php :: php get client ip 
Php :: laravel enum migration 
Php :: redirect from index.php 
Php :: php add days to date 
Php :: laravel print exception message 
Php :: yii2 confirm 
Php :: the requested url was not found on this server. laravel 
Php :: redirect wordpress 
Php :: woocommerce remove related products 
Php :: laravel Post model for flat file CMS 
Php :: php artisan optimize command 
Php :: how to use sseders in laravel 
Php :: cast string to int php 
Php :: run artisan command from controller 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =