I have a page that allows users to create and submit posts.
In order to determine the time of their post, I used timestamp
in mysql.
Here's a sample of one of the timestamps in my data:
2017-05-07 16:12:44.415472
Using php (or javascript if there's actually no other way), how can I make it display something like this:
Sunday, May 07, 2017 4:00PM
I also want to display the post's age like posted 2 hours ago
.
I figured if you put a timestamp every time the page reloads, and then compare/subtract it to the post's original timestamp, it would create a result similar to what I described. Is this however possible? If so, how can I do this?