Get next 2 days not counting current day in PHP

45 Views Asked by At

I have an Unix timestamp like this 1660293621 (2022-08-12 8:40). I want to get next 2 days not counting current date. I expect the result to be 2022-08-15 00:00. I tried

strtotime("+3 Days", $current_date)

but it returns 2022-08-15 8:40, not 00:00

How can I get that in PHP? Thank you~

2

There are 2 best solutions below

1
Stern On BEST ANSWER

I figured it out, just add 0:00 will help

$next2days = strtotime("+3 days 0:00", $current_date);
1
Haris Isani On
$Today=date('y:m:d');

// add 3 days to date
$NewDate=Date('y:m:d', strtotime('+3 days'));

Reference: Increase days to php current Date()