Answers for "php datetime add"

PHP
5

php date + one day

<?php
$stop_date = '2009-09-30 20:24:00';
echo 'date before day adding: ' . $stop_date; 
$stop_date = date('Y-m-d H:i:s', strtotime($stop_date . ' +1 day'));
echo 'date after adding 1 day: ' . $stop_date;
?>
Posted by: Guest on December-09-2019
1

add 1 day php datetime

$date = new DateTime('2000-01-01');
$date->add(new DateInterval('P1D'));
Posted by: Guest on November-04-2020
0

PHP Date add days

$date = date('Y-m-d', strtotime("+1 day"));
Posted by: Guest on June-30-2021
0

php datetime add 1 weeek

$date = new DateTime();
$date->modify('+1 day');
$date->modify('+5 week');
Posted by: Guest on November-26-2020
0

adding days in datetime php

<?php
$date = new DateTime('2016-06-06'); // Y-m-d
$date->add(new DateInterval('P30D'));
echo $date->format('Y-m-d') . "\n";
?>
Posted by: Guest on October-06-2021
0

datatime add time in float

>>> import datetime
>>> d = datetime.datetime(2016, 11, 17)
>>> delta = datetime.timedelta(hours=4.1326742)
>>> d + delta
datetime.datetime(2016, 11, 17, 4, 7, 57, 627120)
Posted by: Guest on March-06-2020

Browse Popular Code Answers by Language