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 string to boolean in PHP?
- How to convert number to month name in PHP?
- How to convert a string into number in PHP?
- How to convert array to SimpleXML in PHP
- Program to Convert List to Map in Java
- How to convert an image to base64 encoding in PHP?
- Program to convert IP address to hexadecimal
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.