问题
need to format columns c, e and a few others to show the date using the format below:
4 July 2014
Can't work out how to do it ... new to google script!
回答1:
To do this using Apps script, you can use the setNumberFormat(numberFormat), which lists that date formats follow the SimpleDateFormat specification.
Sample code that will do this:
function formatDate(){
var ss = SpreadsheetApp.getActive();
var sheet = ss.getActiveSheet();
sheet.getRange("A2").setNumberFormat('dd MMM yyyy');
};
来源:https://stackoverflow.com/questions/27589578/google-apps-script-changing-column-format