0

My current function looks like this:

        function getThisDayAsArray() {
        return array(
            "y" => date("Y", $this->properDateTS),
            "m" => date("m", $this->properDateTS),
            "d" => date("d", $this->properDateTS)
        );

    }

and it works fine for returning the correct date. I am trying to have it returning always +1 day from the currenty one.

$date = new DateTime('+1 day'); 

fails for me. Any suggestions?

3
  • 3
    $date = new DateTime('+1 days') Commented Sep 11, 2018 at 19:08
  • Thanks. Turned out to be a typo. Commented Sep 11, 2018 at 19:50
  • @Osama why not make your comment an answer Commented Sep 12, 2018 at 1:05

1 Answer 1

1

The right syntax to add a day to the date object is

$date = new DateTime('+1 days') 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.