JP128 Posted December 17, 2006 Author Share Posted December 17, 2006 the dob is a var char... Quote Link to comment Share on other sites More sharing options...
JP128 Posted December 17, 2006 Author Share Posted December 17, 2006 Ok, here is all the info... the column join date is a timestamp.I insert into that column with a mysql_query, and the now() function.when I call that date, and try to format it into m/d/Y h:i:s ... it always comes out Dec, 31 1969 4:33:26 PM... Quote Link to comment Share on other sites More sharing options...
JP128 Posted December 18, 2006 Author Share Posted December 18, 2006 Something that I found on the internet...POST: LOL - it says "Googlebot last successfully accessed your home page on Dec 31, 1969" - does that make my site on of the oldest on the net? :)REPLYActually, that date occurs when a timestamp isn't valid...looks like a possible but in the code. ;) Quote Link to comment Share on other sites More sharing options...
chiprivers Posted December 18, 2006 Share Posted December 18, 2006 When you use the date() function to format the display of a date and/or time in php, the specified date/time should be in a timestamp format, not as returned from the mysql database. A timestamp is an int that represents the number of seconds passed since the epoch (01 Jan 1970).To use the date() function you should convert your returned datetime valye from mysql using the strtotime() function.try this:<?php$time = strtotime($row['joined_date']);$newTime = date("m/d/Y h:i:s",$time);?> Quote Link to comment Share on other sites More sharing options...
trq Posted December 18, 2006 Share Posted December 18, 2006 Pfff... my bad. I completely overlooked that. Maybe I need a break? Quote Link to comment Share on other sites More sharing options...
JP128 Posted December 18, 2006 Author Share Posted December 18, 2006 Wow... I am sorry that I took your time... I didnt realize that the error was that simple, because I have tried that once, and I had a different time... Well, Thanks Thorpe! 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.