• 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

wordpress : How to specify the cause "This site can’t be reached"

PHP rotate matrix counter-clockwise

Is there a way to use the same parameter into multiple place in the same query with Eloquent? [duplicate]

Problems getting instance of UploadedFile in Yii2

How to find the date a user created their Google account

mysql_result is defined but mysql_free_result warns it expected a resource

PHP Find Array Index value in multi-line array

Access denied for user 'homestead'@'localhost' (using password: YES)

No result using makeStyles Material UI in react 18

Laravel 5.2: Unable to locate factory with name [default]

How can I pass the list to the component variable in Laravel?

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

PHP - Store information with NO database

Get data from accuweather api url

How to create laravel storage symbolic link for production or sub domain system?

About Contact Privacy policy Terms and conditions