• 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

mysql_result is defined but mysql_free_result warns it expected a resource

Why i get wrong output for html markdown?

Lumen - Postgresql setup - Composer

how to prevent float variables displaying as scientific notation when printing [duplicate]

how to remove %20 in the url in php

Laravel Delete and Update

How to add a heading in between checkout fields of WooCommerce

Merge column values from two arrays to form an indexed array of associative arrays

Adding Multiple Custom Post Types in Wordpress

SlimExceptionHttpNotFoundException

Yii2 redirecting to previous page after login

Select option from dropdown menu with PHP and mySql

Laravel get user data with profile

500 (Internal Server Error) with Laravel & Docker [duplicate]

php echo remove slashes from url [duplicate]

About Contact Privacy policy Terms and conditions