theOlster Posted September 26, 2006 Share Posted September 26, 2006 Hi - I'm currently writing a family tree website and are having problems with really old dates. [quote]The following code:$return = date("l d F Y", mktime(0, 0, 0, 1, 1, 1234));echo "$return";[/quote] Returns:[quote]Thursday 01 January 1970[/quote]Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/22090-problems-handling-really-old-dates-in-php/ Share on other sites More sharing options...
HuggieBear Posted September 26, 2006 Share Posted September 26, 2006 As far as I know, the mktime() function gives you seconds from the epoch, which on your system is 01/01/1970 so it won't go any earlier than this without some calculation somewhere.Have you done a search on these forums? I just did a few searches and came up with a few really useful results... [url=http://www.phpfreaks.com/forums/index.php/topic,89933.0.html]Here's one[/url] for a startRegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/22090-problems-handling-really-old-dates-in-php/#findComment-98864 Share on other sites More sharing options...
craygo Posted September 26, 2006 Share Posted September 26, 2006 There is a class called adodb. You call on it in your script and it will handle old dates. Try googling it or I will post link when I find it. Quote Link to comment https://forums.phpfreaks.com/topic/22090-problems-handling-really-old-dates-in-php/#findComment-98868 Share on other sites More sharing options...
craygo Posted September 26, 2006 Share Posted September 26, 2006 OK here is the file. I hope I can do this whithout getting in trouble if Iam not suppose to I am sorry and you may just delete this.Use it like so[code]<?phprequire('includes/adodb-time.inc.php');$startdate = adodb_date("d-M-Y", adodb_mktime(0,0,0,1,1,1869));?>[/code]Ray[attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/22090-problems-handling-really-old-dates-in-php/#findComment-98872 Share on other sites More sharing options...
theOlster Posted September 26, 2006 Author Share Posted September 26, 2006 Thanks Guys for all your help...More info can be found on ADOdb here: [url=http://phplens.com/phpeverywhere/node/view/16]http://phplens.com/phpeverywhere/node/view/16[/url]. Quote Link to comment https://forums.phpfreaks.com/topic/22090-problems-handling-really-old-dates-in-php/#findComment-98877 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.