• 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

Attempted to call an undefined method named "get" of class "MailController"

array_map triple dimensional array [duplicate]

Inserting data into SQL Server Db An Invalid direction was specified

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

Laravel Unknown Column 'updated_at'

How to fix bootstrap multiselect search data using ajax

SQL AVG() to 2 decimals

How to create custom authentication in laravel 8?

What is my SQL missing?

How to identify whether webp image is static or animated?

Laravel dosen't connect with Oracle

How to trim a video by 4 fragments to 4 seconds using the PHP-FFMpeg?

Put content of wordpress page inside div

PHP function Not Working As Expected From functions.php Include File

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

About Contact Privacy policy Terms and conditions