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
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.
Share on FacebookShare on TwitterShare on LinkedInSend email
1 answer
x
x
2024 AnswerTabsTermsContact us