• 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

php echo xml documents with header

How to run a shell as root from php (apache)

Symfony 4: how to allow dynamic values for array nodes in bundle configuration?

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

Toggle between a textbox and a select using PHP

nginx err_connection_refused, can anyone help me?

add_action() function in wordpress not working [duplicate]

Display a product custom field only in WooCommerce Admin single orders

PHP Download MP3 files from directory on server

Distribute array row data to make multiple new rows

Testing subscription renewals on Stripe

Pagekite error: FAIL: localhost:8080 is down

Custom post type single page not working

Dropdown with current value from Mysql

Display the WooCommerce product price inside a custom function

About Contact Privacy policy Terms and conditions