• 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

Composer Script echo

Is there a way to use Foundry Model for Authentification inside Functional Tests?

laravel controller function parameters

Cut an arabic string

Live search query using JS and PHP for QA forum

How to map the two arrays with a duplicate value?

Elasticsearch - Want to sort by field in all indices where that particular field available or not if not then avoid it

Laravel lang slug in url

laravel MVC execution flow

How to downgrade or install a specific version of Composer?

Laravel after login Two factor not working

How to get rid of ampersand using WP Nonce URL and WP Redirect or PHP header

PHP rotate matrix counter-clockwise

How to set a domain name with php artisan serve

enable Apache http Authorization header

About Contact Privacy policy Terms and conditions