By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!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
So, 10 years from today is:
echo %@agedate[%@eval[%@makeage[%_date] + %@makeage[1/1/1611]]]
I basically used @makeage to give a magic number that represents 10 years. Since @makeage[1/1/1601] returns 0, I figured 1/1/1611 would be 10 years.
Code:So, 10 years from today is: echo %@agedate[%@eval[%@makeage[%_date] + %@makeage[1/1/1611]]]
echo %@agedate[%@eval[%@makeage[1970-05-23] + %@makeage[1611-01-01]]]
I'm creating a digital certificate and I want the expiration date to be 10 years from today. I don't think a day plus or minus will matter much.So 10 years from May 23, 1970 would be:
Code:echo %@agedate[%@eval[%@makeage[1970-05-23] + %@makeage[1611-01-01]]]
10 years could be 3652 days, or 3653 days, or even (very rarely) 3651 days.
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.I'm creating a digital certificate and I want the expiration date to be 10 years from today. I don't think a day plus or minus will matter much.
What is the easiest way to compute a date that is 10 years from today?
echo %@yearadd[2012-02-29,10]
2/28/2022
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.10 years could be 3652 days, or 3653 days, or even (very rarely) 3651 days.