Given a time and the task is to convert timestamp to time ago. The time ago format removes the problem of different time zones conversions. Given below is a function to do the time conversions. In this function, taking the timestamp as an input and then subtract it from the current timestamp to convert it into the time ago format. To make this function, need to define some rules which determine the year, month, date, minutes etc from the remaining date after subtraction.
6 years ago 5 days ago
5 seconds ago
- Convert timestamp to readable date/time in PHP
- Python program to convert time from 12 hour to 24 hour format
- Convert time from 24 hour clock to 12 hour clock format
- HTML | DOM timeStamp Event Property
- How to convert a string into number in PHP?
- How to convert array to SimpleXML in PHP
- How to convert number to month name in PHP?
- How to convert XML file into array in PHP?
- How to convert string to boolean in PHP?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.