Get date of tomorrow, day after, yesterday, day before - PHP

How to get the date of tomorrow and day after, yesterday and day before in standard format ? What PHP function should I use to get these values ?
0
give a positive ratinggive a negative rating
13 Mar 2020 at 01:45 PM
Hi,

Simple method how to get the date of tomorrow, yesterday, etc. is to use:

$tomorrow = date( "Ymd", strtotime( "+1 days" ) );
$dayaftertomorrow = date( "Ymd", strtotime( "+2 days" ) );
$yesterday = date( "Ymd", strtotime( "-1 days" ) );
$daybeforeyesterday = date( "Ymd", strtotime( "-2 days" ) );

The date format can be modified, so you should get what you need.
0
give a positive ratinggive a negative rating
17 Mar 2020 at 03:36 PM
Tim
Share on FacebookShare on TwitterShare on LinkedInSend email
x
x
2024 AnswerTabsTermsContact us