-1

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~

Stern
  • 29
  • 6

2 Answers2

0
$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()

0

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

$next2days = strtotime("+3 days 0:00", $current_date);
Stern
  • 29
  • 6
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 02 '22 at 07:01