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 ?
posted on 13.03.2020 at 13:45
0pnshow more
onefiveonefive
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.
posted on 17.03.2020 at 15:36
0pnshow more
TimTim
share on facebookshare on twitter
2020 AnswerTabsTermsContact us
This site uses cookies to improve your experience, for analytics and ads. By continuing to browse this site you agree to our use of cookies.