In a Google Apps script I am using to create leave request approvals I am using the following text to return the appropriate time in an email generated by the script.
Utilities.formatDate(new Date(row.timeToLeaveSchool), "CST", "h:mm aa")
It was working well until today it was pointed out to me that the returned time is showing GMT instead of CST. I've tried GMT-6 instead of CST and also just altering the timezone to see if it impacted the script.
Both the script and spreadsheet attached are set for CST.
Any help would be appreciated.
Try using
Utilities.formatDate(new Date(), "GMT-06:00", "h:mm aa")
According to this page:
So, CST probably doesn't work for this reason. And to clarify, "GMT-6" does not work but "GMT-06:00" does work.