0

This was working yesterday and then just quit working today with the error "Cannot find method formatDate(string,string,string).". Any idea why this is going on?

var today = new Date();
sheetArchive.getRange('X3:X3').setValue(Utilities.formatDate(today, Session.getScriptTimeZone(), "yyyy-MM-dd HH:mm:ss")); // date submitted
5
  • Is your script is deployed? Commented Nov 7, 2017 at 4:58
  • 1
    Doesn't look like there's anything wrong there. Can you provide a minimal reproducible example? Commented Nov 7, 2017 at 5:33
  • 3
    Break up your chained code into multiple lines for debugging purposes. You can put it all back on one line after you've found the problem. It might be an incorrect error message. It could have been a temporary service disruption. It could be a bug. In any case, you'll need to get some more information. Commented Nov 7, 2017 at 12:55
  • 2
    Can replicate it too. Calling Utilities.formatDate(new Date(), x, y) works, Utilities.formatDate(today, x, y) fails with the same error message. Commented Nov 8, 2017 at 9:08
  • It was stupid syntax error in my case. I accidentally called method without parameter and passed this empty param as formatDate() first param. Commented Nov 8, 2017 at 9:16

1 Answer 1

2

Google must have had an error, I have not changed anything and then it started working again the next day.

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.