EQUALLY SPACED DATES

Problems with syntax of GAMS
Post Reply
pzezza
User
User
Posts: 3
Joined: 6 months ago

EQUALLY SPACED DATES

Post by pzezza » 6 months ago

Hello, I have the following problem:
I have a given final date, let's say March 17th, 2025 and I want to construct a list of equally spaced preceding dates. The space could be 2,3,4,6 months so that the dates repeat annually. (For a 6 months interval) I would have 3/17/2025, 9/17/2024, 3/17/2024, 9/17/2023, ... , 3/17/2018 I stop here because the next would be before Today. Analogously if I have a different spacing in months. I have many couples (date, n) with n= 2 or 3 or 4 or 6 and I have to repeat the same procedure for all of them.
I know how to add or subtract a given number of days but I don't know how to do it by months.
Thanks
Pierluigi

Post Reply