• 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

Get WooCommerce product variation attribute terms in admin products general box

Wordpress wpdb->delete issue

str_replace or preg_replace random number from string

phpseclib 2.0 can not use Composer to create autoload

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

How do I get friend list from Friends table with counts of friends of my friends

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

Clear javascript source cache laravel 5.8

Query Optimization, changing the queries in the loop into a single processing query

PhpSpreadSheet: How to save Workbook sheets in individual CSV files

Issue with laravel eloquent model property

wordpress function breaks wp-admin

java URL working on browser but not in client program

Laravel lang slug in url

MOODLE: What does it mean to aggregate h5p assets?

About Contact Privacy policy Terms and conditions