Change dates to relative time format 5/04/2023 12:00am = 9 hours ago

Change dates to relative time format 5/04/2023 12:00am = 9 hours ago

I have put some code together so that now you can display dates in a relative to the current time format. For example. Instead of 05/04/2023 12:00am this code changes it to 9 hours ago for example. It picks up seconds, minutes, hours, days, weeks, months, and years. This works on all lists, tables and detail sections and this works every time the page is loaded. Knack timestamps can be a bit cumbersome to interpret at first glance. However, with this code, you can easily transform those timestamps into more readable relative time representations based on the current time. By providing a Knack timestamp as input, the code will calculate the time difference between that timestamp and the current time. It will then generate a relative time expression that indicates how long ago the event occurred. This can be incredibly useful for various applications, such as displaying recent activity or organizing time-sensitive data.


To view full content