I have a google sheet with a column that has a data that looks like this.
8/31/2017 11:45:41
and that format is Date Time
now when Im using the google code .getValues
and display it in Logger.log
this is the output
Fri Sep 01 02:45:41 GMT+08:00 2017
My Question is How can I get the value as it is? I dont want to get it as time stamp I want the format like 8/31/2017 11:45:41
or M/D/YYYY HH:MM:SS
really same as what it displays in sheet.
here is my code.
//Convert Timestamp to M/D/YYYY HH:mm:ss
function ConvertToYMDHS(inputFormat){
var userTimeZone = CalendarApp.getDefaultCalendar().getTimeZone();
return inputFormat ? Utilities.formatDate(inputFormat, "GMT-8:00", "M/d/yyyy HH:mm:ss") : "";
}
ConvertToYMDHS("Cell of the Column that has a Date");