Jump to content

Date display issue in PHP/MYSQL


wellbeing

Recommended Posts

Hello everyone,

I have a date-related enquiry. I had previously been using the following code to display dates from a table in a normal format:

(<?php
    $date = strtotime($row->date);
    echo $date = date('j F Y', $date);
?>)

However, this new table I'm working on is full of dates that stretch back to the late nineteenth century, and with the above code, these all get displayed as 1st January 1970.

I am using the 'date' option in Mysql, and from internet searches I understand that this should have a big enough range, so I presume it's clashing with the above code somehow.

At the moment I'm just using <? echo $row->date; ?>, which brings them up fine, but in the not-too-userfriendly mysql format.

Any help would be much appreciated.
Link to comment
https://forums.phpfreaks.com/topic/35279-date-display-issue-in-phpmysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.