• 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

How Can I Do LIMIT 1, 2 In WP_Query

Laravel insert dynamic input values with radio button

MySQL - Connection failed: No route to host

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

mysql slow on updates for a well optimized query

Laravel php artisan serve to mimic HTTPS

wp_remote_get() not passing authentication

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

How to upload mpdf file after generating to s3 bucket in php

Mysqli multi query error

Only on Firefox "Loading failed for the <script> with source"

MySQL upgrade causing unexpected results on simple WHERE clauses

XSS attack still works despite htmlspecialchars() doing its work

How to redirect to another page and call a Function there on Angular ng-click

About Contact Privacy policy Terms and conditions