I'm trying to take information from Google Sheets and use it to send an email with the information given in sheets. I have the email part down, but when I try to editAsText
to delete unwanted characters it won't allow me to. Here is what I am trying to accomplish:
var start = row[5];
returns: Fri Feb 20 2015 00:00:00 GMT+0200 (SAST)
and I want to edit that to be:
Fri Feb 20 2015
Best Answer
You're basically wanting to format a date.
I would act on the JavaScript
Date
object, something like:The variable
formattedDate
now holds a string likeFri Feb 20 2015
.If you want to do this by manipulating strings instead, and you're not concerned with the language settings of the spreadsheet, you could use