My host makes working with MySQL exceedingly difficult; to avoid having to work with MySQL, is there any way to add timestamps to articles by using a table-less “time ago” function, then using echo to display the difference between the current date and the “time ago” date?
My host makes working with MySQL exceedingly difficult; to avoid having to work with
Share
Add a
DATETIMEcolumn to your article table. Then when you insert/update an article you can set the time withWhen you pull the article out you can get the difference:
You can then do something with the seconds $diff like divide by minutes, hours, days, etc.. to show the type of time ago you want.