//The following Process will create a function that will select the 4th Wednesday of every month as the MailDate var currentDate = new Date(); var month = currentDate.getMonth(); var year = currentDate.getFullYear(); //GET FOURTH WEDNESDAY OF MONTH AS MAILDATE function getFourthWednesday (year, month) { var date = new Date(year, month, 1); var day = date.getDay(); var daysUntilFourthWednesday = (3 - day +7)%7 + 21; return new Date(year, month, daysUntilFourthWednesday + 1); } var fourthWednesday = getFourthWednesday(year, month); instance.vars.newMailDate = fourthWednesday.toLocaleDateString(); //USE THE BELOW VARIABLE TO ENTER MAIL DATE MANUALLY - COMMENT OUT THE ABOVE instance.vars.newMailDate //instance.vars.newMailDate = new Date("12/06/2023"); logInfo ("Current Date: " + currentDate); logInfo ("MailDate: " + instance.vars.newMailDate); //logInfo ("Month: " + month); //logInfo ("Year: " + year);