Search code examples
phpstrtotimedate-math

Get next 2 days not counting current day in PHP


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~


Solution

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

    $next2days = strtotime("+3 days 0:00", $current_date);