I'm working on a project where I need to convert a Unix timestamp to a "time ago" format (e.g., "2 hours ago," "3 days ago," etc.) using Twig. I've tried using the {{ created|date('M Y, D') }}
function, but it only provides a regular date and time format.
Can someone please guide me on how to modify the code to achieve the desired "time ago" format? I want to display the elapsed time since the timestamp in a more human-readable format.
If there are any specific functions, libraries, or code examples available in Twig that can help with this conversion, I would greatly appreciate the guidance.
Thank you in advance for your assistance!