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
- Convert date string to timestamp in Python
- 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
- Difference between Turn Around Time (TAT) and Waiting Time (WT) in CPU Scheduling
- Just In Time Compiler
- PHP | time() Function
- HTML | <time> Tag
- PHP | Date and Time
- 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.