I'm looking for a way to filter for events that happened between previous September (1st) and upcoming September (1st) every year. Since the filter is already part of an existing piece of code I can ony add a fixed date (timestamp) or use a relative date that runs through php strtotime. I can't run any php in the field.
Because a timestamp is fixed for a set year, I want to use relative dates to make this filter work every year.
I have tried to build this filter using simple things like [last/next] September
, but that is invalid strtotime syntax.
From there I tried things like 9/1 [last/this/next] year
. They were valid, but since I can't use logic to determine which one to use, it is not good.
- For dates prior to this year September 1st the filter would be
9/1 last year
>9/1 this year
- For dates past September 1st this year it is
9/1 this year
>9/1 next year
.
So to summarize, I am looking for a relative date string (strtotime) to get the previous September 1st and a string for the upcoming September first. (If they exist.)