wellbeing Posted January 22, 2007 Share Posted January 22, 2007 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. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 timestamps start at 1970, the unix epoch. You can't have a strtotime() before then. Quote Link to comment Share on other sites More sharing options...
wellbeing Posted January 23, 2007 Author Share Posted January 23, 2007 Thanks for the reply. Yes, I read about that 1970 thing, but is there a way around it? Quote Link to comment Share on other sites More sharing options...
Caesar Posted January 23, 2007 Share Posted January 23, 2007 What format are the dates being stored as? Quote Link to comment Share on other sites More sharing options...
wellbeing Posted January 23, 2007 Author Share Posted January 23, 2007 [quote author=Caesar link=topic=123564.msg511002#msg511002 date=1169511562]What format are the dates being stored as?[/quote]Hello, Of the available options, I'm using 'date', the others being 'datetime', 'timestamp', 'time' and 'year'. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.