Getting time difference from now

We can use the following javascript code to get the date difference in readable format e.g: Khalil posted a comment on ‘2024-05-10T01:25:14.317Z’ is less readable than Khalil posted a comment 7 hours ago. I have used the library ( to achieve. Sample Code Code link github – Live Application: Live Application URL: