Muncey Posted July 18, 2007 Share Posted July 18, 2007 Basically im putting a join date into the database but i don't want it displayed as a date, i want it as pure numbers so that i can use it to work out things such as how long they've been a member, comments per day (by dividing the posts by how many days they've been a member) ect ect So whats the best way of putting that into the database? I have a vBulletin forum and looked in the database at what they had for the join date and i saw stuff like 112823... is that seconds or something? I also need to display the date as a real date xx/xx/xx so that must be possible aswell. Quote Link to comment Share on other sites More sharing options...
Barand Posted July 18, 2007 Share Posted July 18, 2007 Store it is type DATE. You can easily calc how long they have been a member by using SELECT DATEDIFF(joindate, CURDATE()) as totaldays FROM mytablename. Also it's easy to format to any output display style you want using Mysql DATE_FORMAT() function or by using PHP date() function. Quote Link to comment Share on other sites More sharing options...
Muncey Posted July 18, 2007 Author Share Posted July 18, 2007 Unsure of what you mean, what exactly am i storing as a date type? Im inporting $date into the database under join_date... what do i need $date to equal in order to make the date display as something i can use for various things such as how many days been a member but also display join date as xx/xx/xx 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.