Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Adding or Subtracting Time

$dateTime = new DateTime('2016-01-01');
$dateTime->modify('+1 day');
echo $dateTime->format('Y-m-d H:i:s');`
# Output: 2016-01-02 00:00:00

# You can as well use the constructor if you work on the current date:



$dateTime = new DateTime('+1d');
echo $dateTime->format('Y-m-d H:i:s');`
# Output the current date plus one day.
Comment

PREVIOUS NEXT
Code Example
Php :: php check how much time each instruction takes to complete 
Php :: execute artisan command from route 
Php :: laravel foreach else 
Php :: php code to increase maximum execution time 
Php :: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`)) 
Php :: php get previous url 
Php :: pdo transaction 
Php :: session unset 
Php :: php header pdf open in browser 
Php :: laravel pagination bootstrap 5 
Php :: wordpress get post thumbnail url 
Php :: “laravel migration data types” 
Php :: disable gutenberg editor wordpress functions.php 
Php :: how to install bootstrap in laravel 
Php :: +1 month php 
Php :: artisan make model with migration 
Php :: php cut off first x characters 
Php :: guzzle bearer token 
Php :: php set content type pdf 
Php :: laravel carbon today date format 
Php :: db not found in laravel 
Php :: phpmailer add reply to 
Php :: php get everything after last slash 
Php :: init hook wordpress 
Php :: disable foreign key laravel 
Php :: php file_get_contents url 
Php :: laravel model to array 
Php :: laravel return 1 as true 
Php :: eloquent cast date 
Php :: How to Disable the WordPress JSON REST API Without Plugin 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =