• 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

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

retrieve data from database using session

Alert message after submitting form in PHP

How to edit Records using CodeIgniter

Hide email address with stars (*)

Sliders in Laravel

How do I truncate a decimal in PHP?

How to validate tin and cst using PHP?

IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1 no such table - In clone project

Issue with laravel eloquent model property

how to remove %20 in the url in php

Warning file_get_contents () failed to open stream: HTTP request failed! HTTP/1.0 402 Payment Required

phpunit - mockbuilder - set mock object internal property

PHPExcel How to set conditional formatting to change cell background color based on cells values

Get latest Tweets - What API

About Contact Privacy policy Terms and conditions