• 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

Why does codeigniter & Linux server throws unserialize() session data error when user tries to login

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

PHP how to detect if running on arm64 cpu?

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

Why rand() every time I refresh the page?

How Can I Do LIMIT 1, 2 In WP_Query

Extract house numbers from address string

How to make Canonicals with PHP

Zig-zag scan an N x N array

I can't delete my image when it is liked because of the foreign key in mysql

How to convert the int value to inch in PHP [closed]

How can I access an array/object?

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

Best way to scrolldown onpageload

Laravel Pagination links() not working

About Contact Privacy policy Terms and conditions