0

I have imported CSV file to google-sheet. I have date there which comes up as 11th of August 2019 however I want it to come up as 11/08/2019. The content of csv file is converted into array and displayed. I am not certain about the approach I can take. I don't want to edit the file. Is there way of doing it without having to edit the file.

I have tried getting the range from the sheet and formatting that way but it doesn't work.


  cells.setNumberFormat("dd-mm-yyyy");

1 Answer 1

1

Using the momentJs library you could just do it as

moment(cells, "Do of MMMM YYYY").format('DD/MM/YYYY')
Sign up to request clarification or add additional context in comments.

1 Comment

vanilla js version: const monthMap = { Januar: "01", Februar: "02", August: "08", Dezember: "12"}; parseInt(cells) + "/" + (monthMap[cells.split(" ")[2]] + "") + "/" + cells.split(" ")[3]

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.