Home > Blockchain >  Get next 2 days not counting current day in PHP
Get next 2 days not counting current day in PHP

Time:08-30

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~

CodePudding user response:

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

CodePudding user response:

I figured it out

strtotime(" 3 days 0:00", $current_date);
  • Related