Sweet! I’m sure this will come in handy in the future. I’m using your last version to tell me how long I’ve been in bed when I get up in the morning rather than uptime and I plan to set something similar up to report how long I’ve been absent from home when I go away for days or weeks at a time.
Aside from being more streamlined, are there any advantages of using your new method? I already have your previous work doing a great job with that first task so I’m wondering if I should bother replacing that older code in what I’ve done so far.
Thanks again!
I was looking how to do this and found this old thread and after a lot of troubleshooting, I figured out that you can simply use the relative_time function.
Just keep in mind that relative_time does not work with dates that are in the future. That’s why we have to create the large template for future events.