6

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 Answer 1

13

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');
};
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.