After the third or fourth time typing date += 1,months in a script and coming up empty, I decided I needed to implement this apparently nonexistent functionality. I did few Google searches for this purpose and was met with a similar lack of success, so I figured I’d share my results here.
This function will take an arbitrary date and add (or subtract) a given number of months from it. If you want to return the date three months from today, throw today’s date and a positive 3 at the function. If you wanted to return what the date was 3 months ago, just make it a negative 3 instead. It’s fully fleshed out in the comments if you are interested.
The script is available at my GitHub. You can grab it here. Be sure to throw it in your Program Files/AutoHotkey/lib folder to make it available for any future scripts.
PS: Thanks go to my friend Joe, without whom I’d have forgotten to deal with leap years. Please let me know if you find any issues with the script, or even better, if you have found/made something more elegant.