Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP_Date( 'AddMonths') for negative numbers

I'm just testing out the v2.1.10 "Fixed bug in SRP_Date where using negative numbers in AddMonths returned wrong results" using v2.1.11.
It seems that subtracting 5 months or more from the current date returns a null result. Eg, SRP_Date( 'AddMonths', date(), -10) returns null. Is this expected?

Cheers, M@


  • Better - except for the following values, for some reason ;)


    I've only checked up to -1000, but presumably there's a pattern here.

    Cheers, M@
  • edited May 27
    Used "LT" instead of "LE", rookie mistake. It's a good thing you're a better tester than me. This one should do the trick.
  • Ah - I see the pattern! -5 (May) then -12 each after that, so something to do with year boundaries :).
    Yes, this version works fine - thanks :)
Sign In or Register to comment.