PHP Help with time since x happened
Posted: Tue Nov 01, 2016 7:02 am
Hey guys,
Been awhile I know, but I am working on a new project. It is a ticketing system.
One of the features on the site is a chat box, you can enter a message and click send and the message will show up with your name however I want to know if anyone knows of a function i can put in to be able to show for example "Posted 5 minutes ago" or "Posted 1 week, 2 days ago" in the chat.
I know there are a few examples hanging around online but I've had trouble getting them to work.
The way I generate the time in my mysql database is with this:
![Image]()
Any help would be greatly appreciated
Been awhile I know, but I am working on a new project. It is a ticketing system.
One of the features on the site is a chat box, you can enter a message and click send and the message will show up with your name however I want to know if anyone knows of a function i can put in to be able to show for example "Posted 5 minutes ago" or "Posted 1 week, 2 days ago" in the chat.
I know there are a few examples hanging around online but I've had trouble getting them to work.
The way I generate the time in my mysql database is with this:
Code: Select all
that's hours:minutes am/pm$timeadded = date("h:ia");

Any help would be greatly appreciated
