ISO: %@eval[%_year + 10]-%_month-%_day
(or use your own style)
assuming you are not close enough to midnight of the last day of a month so the date might change between retrieving its various parts
ISO: %@eval[%_year + 10]-%_month-%_day
(or use your own style)
assuming you are not close enough to midnight of the last day of a month so the date might change between retrieving its various parts
I think you should simply add 10 years to the "current" date, then add one *day* if the ending date is "29/feb" for a non-leap year (i.e.: simply replacing day and month with 01/mar).
13/11/1970 + 10 years is 13/11/1980.
29/02/2012 + 10 years is 01/03/2012.
Just like children born today - when will their birthdays be in non-leap-years? The problem is not the day count; it is specifying a leap day in a non-leap-year.
When I first read that I did a double-take, and even after thinking about it it took me a while. I guess that 3651 probably isn't worth worrying about since it hasn't happened for over a hundred years and won't for another 80. Obviously for Scott's certificate expiry example then using 3652 days would seem a decent compromise but if you desire an 'accurate' result then the only way to be sure is to use the 'add ten to the year' method and cater for the special case of 29th Feb.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.