How to get friendly date formats with Stacker Formulas - like "Yesterday", "2 days ago", "6 months ago" etc

I’ve been using the new Created Time field type in my formulas and created a big formula today to show the relative date between now and when the record was created. I thought this might be useful to others in the community. If your field is called {Created Date} then this is what you need:

IF(DATEDIF({Created Date}, NOW(), "months") > 1,DATEDIF({Created Date}, NOW(), "months") & " months ago", 
    IF(DATEDIF({Created Date},NOW(),"months") = 1,"A month ago",
        IF(DATEDIF({Created Date},NOW(),"weeks") > 1,DATEDIF({Created Date}, NOW(), "weeks") & " weeks ago", 
            IF(DATEDIF({Created Date},NOW(),"weeks") = 1,"Last week",
                IF(DATEDIF({Created Date},NOW(),"days") > 1,DATEDIF({Created Date}, NOW(), "days") & " days ago",
                    IF(DATEDIF({Created Date},NOW(),"days") = 1,"Yesterday",
                        IF(DATEDIF({Created Date},NOW(),"hours") > 1,DATEDIF({Created Date},NOW(),"hours") & " hours ago",
                            IF(DATEDIF({Created Date},NOW(),"hours") = 1,"An hour ago",
                                IF(DATEDIF({Created Date},NOW(),"minutes") > 1,DATEDIF({Created Date},NOW(),"minutes") & " minutes ago",
                                    "Just now")))))))))

In my app this now looks like this in a Highlights widget:

Screenshot 2022-10-05 at 11.14.18@2x

4 Likes