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 )); ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With