Jump to content

Number of days


master82

Recommended Posts

In my users table in my mysql database I have the field "created", in the format of CURRENT_TIMESTAMP (which upon inserting a new record uses NOW() as a default) resulting in a format of 2006-03-21 12:48:14.
I use this as when a member registers it automatically places the date and time within.

Now what I need is to create a php page with all the members information, including the number of days they have been a member.

I've tried to place the created date into a variable and used NOW(), DATE(), TIME(), CURDATE(), CURTIME() etc to get the current date (subtracting one from the other) but it doesnt seem to work when trying to subtract the two dates.

Also I need the result displayed in number of days.


Anyone know how I can proceed to achieve this?
Link to comment
https://forums.phpfreaks.com/topic/5618-number-of-days/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.