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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.