How long ago ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
niki_noki
Forum Newbie
Posts: 17
Joined: Tue Aug 16, 2011 8:58 am

How long ago ?

Post by niki_noki »

Hello all :))

I have any question. How can I pull through php to how long before an item is added. The database also add itdate('d/m/Y H:i:s');
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: How long ago ?

Post by twinedev »

You may want to try rewording that and giving more information. I am not sure what you are asking.
xtiano77
Forum Commoner
Posts: 72
Joined: Tue Sep 22, 2009 10:53 am
Location: Texas

Re: How long ago ?

Post by xtiano77 »

Without your code it is somewhat difficult to answer your questions; however, if what you are trying to accomplish if for a page to show the information of when it was last updated by you (re-writing the code, etc...), JavaScript has a function that does just that:
http://www.w3schools.com/jsref/prop_doc ... dified.asp
You could also try adding a field to the database and use the SQL "FORMAT( )" and "NOW( )" function[s] in order to save the date format you want and later display it on your page.
http://www.w3schools.com/sql/sql_func_format.asp

Hope this helps!
Post Reply