• 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

phpmyadmin : Depends: php-twig (>= 2.9) but 2.6.2-2 is to be installed. WHAT?

Object of class stdClass could not be converted to string error

How to downgrade or install a specific version of Composer?

PHP: Calling MySQL Stored Procedure with Both INPUT AND OUTPUT Parameters (NOT "INOUT")

PHP: How to quickly split a key=value file into associative array

Laravel Collections. Is there some kind of assertStructure method?

Remove product downloads section in woocommerce email notifications

Python - Include another Python script

Android Volley getParams() method not getting called for JsonObjectRequest

Best way to scrolldown onpageload

How to get values inside <![CDATA[values]] > using php DOM?

PHP AWS Cognito 'Error executing "SignUp" : ResourceNotFoundException : User pool client XXXX does not exist

how to sort by a custom appended relation to model

Show Custom Data in Woocommerce Order Details Admin Area

Laravel Database Strict Mode

About Contact Privacy policy Terms and conditions