psorensen
psorensen

Reputation: 827

PHP Unix to Date

When I var_dump a particular variable, I get:

'date' => int 1410307200

When I var_dump date('F j Y', strtotime($start_date)), I get:

string 'January 1 1970' (length=14)

I get the same output when I don't use strtotime.

Why does it keep returning the epoch time?

Upvotes: 0

Views: 58

Answers (1)

John Conde
John Conde

Reputation: 219884

You're calling strtotime() on a Unix Timestamp. That's redundant and an error:

echo date('F j Y', $start_date)

Upvotes: 3

Related Questions