0

I am trying this code:

date('d F Y', '2013-09-14 00:00:00')

and I am expecting back

14 September 2013

Instead, I am getting

31 December 1969

Does this make any sense at all?

1
  • 1
    Parameter 2 must be timestamp, strtotime(date_string) should sort this Commented Oct 7, 2013 at 19:45

1 Answer 1

8

You need to wrap your target date in strtotime() function:

date('d F Y', strtotime('2013-09-14 00:00:00'));
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.