Web_Designer
Web_Designer

Reputation: 74530

php date misinterpretation

I run this:

echo date('l, F jS Y','2011-02-12 14:44:00');

I get this:

Wednesday, December 31st 1969

What's wrong?

Upvotes: 0

Views: 42

Answers (1)

deceze
deceze

Reputation: 522016

The second argument for date needs to be a UNIX timestamp, not a date string. Use:

echo date('l, F jS Y', strtotime('2011-02-12 14:44:00'));

http://php.net/manual/en/function.date.php

Upvotes: 5

Related Questions