• 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

Sliders in Laravel

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

"Unable to load dynamic library 'pdo_sqlsrv.so' "Cenos7 PHP7.2.10

Get image type from base64 encoded src string

PHPS source file - 403 Forbidden You don't have permission to access this resource

How can I make a full text index of the column?

Toggle between a textbox and a select using PHP

What is my SQL missing?

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Distribute array row data to make multiple new rows

Laravel get user data with profile

Lumen - Postgresql setup - Composer

protect images from being copied

Check If array is null or not in php

how to get the header value, if we don't know the value because the value is random from the server

About Contact Privacy policy Terms and conditions