date() or format_date() returning 1970?
I have a table with a date field, which is correctly populated.
When I do the following<?php print $mytable->date; ?>
works fine; however, when I format it with date()
or format_date()
it开发者_运维百科 just returns 01/01/1970.
It's stored in an array before being put into an HTML table if that makes a difference.
You could use the following (if the format of $mytable->date
fits strtotime()) and adopt first parameter to your needs:
<?php echo date('Y-m-d H:i:s', strtotime( $mytable->date )); ?>
精彩评论