strtotime fails for valid date
Posted
by Funky Dude
on Stack Overflow
See other posts from Stack Overflow
or by Funky Dude
Published on 2010-06-17T00:23:14Z
Indexed on
2010/06/17
0:32 UTC
Read the original article
Hit count: 211
php
i am doing a project where i need to output date of orders. and i do the following inside a for loop
<?php echo date('M d, Y g:i A',strtotime($order['Order']['created']));?>
for some strange reason, sttotime returns false. (Dec 31, 1969 7:00 PM appears instead.)
i made sure $order['Order']['created'] is not empty and is valid.
even stranger, that exact same piece of code works fine on the other page, only different is that, that one is not in a loop. but that cant be the reason right?
i set timezone to America/New_York and $order['Order']['created'] is mysql timestamp.
var_dump on said variable
string(27) "2010-06-16 20:12:51"
© Stack Overflow or respective owner