• 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 want to use codeigniter foreign character library in my custom PHP project how i can use it?

How to install ZeroMQ for PHP on an Alpine Linux container?

ConstraintViolationListInterface to Exception in Symfony

Auto increment id JSON

How to Create WooCommerce Subscription Product via. REST API?

How to reset Laravel AuthManager/guards in between API calls in tests?

enroll_table three field fetch to payment form to create payment field in laravel 5.5

Fatal error: Trait 'LaminasDbAdapterLaminasDbAdapterAdapterInterface' not found in /var/www/vendor/laminas/laminas-db/src/Adapter/Adapter.php

Shopify password update using Shopify API

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

How can I format this number correctly using PHP?

loop through an anchor id

PHP cURL (SSL certificate problem: self signed certificate in certificate chain)

laravel MVC execution flow

Add restriction to WooCommerce coupons by allowed user ID

About Contact Privacy policy Terms and conditions