I am creating a script to email vendors when their insurance is
expiring. The script runs but when I post the expiration date in the
email body it has the full date and time. I just want it to have Wed
November 15, 2023 instead of:
Wed Nov 15 2023 00:00:00 GMT-0600 (Central Standard Time). When I try to do this:
var formateddate= new Date(insuranceExpirationDate);
formateddate= Utilities.formatDate(formateddate,'EEE MMM dd yyyy');
I get this error:
The parameters ((class).String) don't match the method signature for Utilities.formatDate
I am not good at this so it may be something crazy simple that is wrong. I am using the insuranceExpirationDate variable for some calculations so I was hoping to leave it alone and create a new variable (formateddate). I assume that it is pulling insuranceExpirationDate as a string but I thought the new Date command would change it to a date. Any help is greatly appreciated.
Thanks!!
Melissa