Jump to content

Dates


Muncey

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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.