• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to set time with DateTime modify?

php


PHP Snippet 1:

$periodauction = '2018-04-09T10:00:00';
$date = DateTime::createFromFormat('Y-m-d\TH:i:s', $periodauction)->modify('-1 day');
$date->setTime(18,0);
echo $date->format('Y-m-d\TH:i:s');

PHP Snippet 2:

2018-04-08T18:00:00

Related Snippets

Jquery DataTables: Data not displaying in table via Ajax

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

How do I remove this delivery notification from here?

How to Display Data in Yajra Datatables Laravel 7?

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

Symfony - "framework.test" config is not set to true

How to average columns of data from multiple, flat arrays?

Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars'

CSV to PHP class properties

Adding multiple items to WooCommerce cart at once

Split comma separated value from table column into rows using mysql?

Get data from accuweather api url

Using PHP to connect to a remote MSSQL database

How to add a sidebar to Woocommerce Shop Page?

Update Total in checkout of Woocommerce with Ajax Request

About Contact Privacy policy Terms and conditions