Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php date format minus 1 day

date('Y-m-d',(strtotime ( '-1 day' , strtotime ( $date) ) ));
Comment

php date minus x days

<?php
//New DateTime object representing current date.
$currentDate = new DateTime();
 
 
//Use the subtract function to subtract a DateInterval
$yesterdayTime = $currentDate->sub(new DateInterval('P1D'));
 
//Get yesterday date
$yesterday = $yesterdayTime->format('Y-m-d');
 
//Print yesterday date.
echo $yesterday;
?>
Comment

PREVIOUS NEXT
Code Example
Php :: install zip php extension 
Php :: how to install bootstrap in laravel 8 
Php :: Syntax error or access violation: 1071 La clé est trop longue. Longueur maximale: 1000 
Php :: file delete in laravel 
Php :: hit a simple url using curl in php 
Php :: get cart page url in woocommerce 
Php :: enable php curl extension ubuntu 20.04 
Php :: php code to convert to small letter 
Php :: php content type xml 
Php :: laravel keep old input 
Php :: check image is available on server php 
Php :: php reset array keys 
Php :: php string mayusculas 
Php :: gd extension docker php 
Php :: php compare two dates 
Php :: php copy file 
Php :: In Connection.php line 664:SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema 
Php :: php get everything after last slash 
Php :: php uppercase each word 
Php :: get php memory limit command line 
Php :: time to load php page 
Php :: fopen(F:xampphtdocsEscubydustoragefonts//themify_normal_f60486608aadd4e36c92c9895f99838f.ufm): failed to open stream: No such file or directory 
Php :: codeigniter get num_rows 
Php :: array merge laravel 
Php :: convert base64 string to pdf in php 
Php :: laravel order by raw 
Php :: get price woocommerce product 
Php :: how to add hour minute seconds in php datetime 
Php :: set subject for mail inlaravel 
Php :: php add string inside string at position 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =