tips:refresh_age
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:refresh_age [2018/01/10 21:23] – [Explanation] toby_goodlock | tips:refresh_age [2018/01/26 19:25] (current) – [Example] toby_goodlock | ||
---|---|---|---|
Line 4: | Line 4: | ||
===== Example ===== | ===== Example ===== | ||
- | '{dh24}' > (string.sub(' | + | |
===== Explanation ===== | ===== Explanation ===== | ||
- | By using this formula in the text field we are comparing the current hour (1-24) to the hour of the last refresh. | + | By using this formula in the text field we are comparing the current hour (00-23) to the hour of the last refresh. |
- | We use {dh24} instead of {dh23} because in the case of 12am comparing to 11pm we would use the values 24 > 23. | + | |
- | + | ||
- | This is with the assumption that you are using 12 hour or 24 hour (0-23) formatting for your time. | + | |
If the current hour is greater then we add 60 to the current minute and subtract the last refresh minutes value. | If the current hour is greater then we add 60 to the current minute and subtract the last refresh minutes value. | ||
If the hours are the same we simply subtract the last refresh minutes from the current minutes. | If the hours are the same we simply subtract the last refresh minutes from the current minutes. | ||
+ | |||
+ | For 12am, we check if the current hour is 00 and if the last refresh hour is 23 and if so make the current hour 24 to do our math. | ||
tips/refresh_age.txt · Last modified: 2018/01/26 19:25 by toby_goodlock