• 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

PHP Get value from JSON [duplicate]

PDOException SQLSTATE[HY000] [2002] No such file or directory

WooCommerce: Add/display Product or Variation custom field everywhere

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

selected value from the listbox in php

TesseractOCR not working for Laravel

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

Any AWS EB Laravel route getting 404 Not Found nginx/1.16.1

Unable to guess the mime type as no guessers are available Laravel 5.2

how can I set a session variable in Drupal 8 and get it in a php script?

Facebook API, get page post link (PHP)

How can I get user id from session in javascript?

I want to display a sweetalert after the inserting of data in my database

protect my blog content

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

About Contact Privacy policy Terms and conditions