• 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

JQuery content editable div and text box on submit not sending POST

Get orders by date and status woocommerce

dockerizing Laravel + vue

Issue saving card for customer

sort() not affecting original array while inside foreach loop

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

PHP Startup Unable to load dynamic library /usr/lib/php/20151012/php_mysqli.dll

Sort multidimensional array by column value within a column

How to install php yaml on CentOs?

Create a zip file and download it

How to fix bootstrap multiselect search data using ajax

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

Wordpress 'post_type_link' hides permalink

Use Python plotly chart in PHP

About Contact Privacy policy Terms and conditions