by Fran T
Version 2 (March 15, 2025)
Download (30 downloads)
A flow which demonstrates formatting long time durations of years, months, and/or days. For example, "3 years, 2 months, 1 day".
For durations on the order of hours or less, the Automate 𝚍𝚞𝚛𝚊𝚝𝚒𝚘𝚗𝙵𝚘𝚛𝚖𝚊𝚝() function can be used. However, due to factors such as leap years and daylight saving time shifts, it doesn't support year and month durations. This flow demonstrates how formatting of long time durations can be done.
To incorporate the formatter into your own flow, copy the subroutine starting at block 14. To perform the formatting, first assign the date interval's starting and ending dates to the variables named 𝚜𝚝𝚊𝚛𝚝𝙳𝚊𝚝𝚎 and 𝚎𝚗𝚍𝙳𝚊𝚝𝚎, then use the Subroutine block to invoke it. The formatted time duration text is returned in the 𝚏𝚘𝚛𝚖𝚊𝚝𝚝𝚎𝚍𝙳𝚞𝚛𝚊𝚝𝚒𝚘𝚗 variable.
The formatter suppresses fields which have values of zero, and makes the English time units plural based on whether their values are 1 or not. (See the example at the top of this description.)
5 stars | 1 | |
4 stars | 0 | |
3 stars | 0 | |
2 stars | 0 | |
1 star | 0 | |
Reports | 0 |
Rate and review within the app in the Community section.