05-12-2016 09:40 AM
I want to create an year value and it should be exact one year from today irrespective of leap year or what ever I have tried the below code
But it was not giving exact exact one year difference it was giving 01-May-2015 but i need 12-May-2015 ie if the job is running today it should calculate exact one year difference.
05-12-2016 09:43 AM
Have you tried
test = intnx('year',today(),-1);
If yes, and it did not give you your wanted result, what was the difference?
05-12-2016 10:02 AM - edited 05-12-2016 10:13 AM
Also, you may want to compare these two to see if they give you the same results for leap years:
intnx('year', today(), -1, 'S')
intnx('month', today(), -12, 'S')
it's possible they are equivalent, but check for a Feb 28, Feb29, and March 1 date to see what you get.
I found time to test them ... they generate the same result.
Need further help from the community? Please ask a new question.