Change date format in email


#1

Hello.

Your system sends the holiday update email with a usa date format and not a british one of DD MM YYYY

How can I change this?


#2

Hi lizzie,

Try changing row 156 in the script as follows:

var email_answer = 'Your vacation request (from '+ formatDate(row[2]) + ' to ' + formatDate(row[3]) + ') was <b>'+ row[5] + '</b>';

var email_answer = 'Your vacation request (from '+ formatDate(row[2], "GMT", "dd-MM-yyyy") + ' to ' + formatDate(row[3], "GMT", "dd-MM-yyyy") + ') was <b>'+ row[5] + '</b>';

See also: https://developers.google.com/apps-script/reference/utilities/utilities#formatdatedate-timezone-format as well as this example.