The day of week returned seems wrong sometimes. Today I executed in Google App Script engine:
Logger.log(Utilities.formatDate(new Date(), "Europe/Madrid", "yyyy-MM-dd F"))
The result was:
[15-10-26 18:18:42:037 CET] 2015-10-26 4
The problem is the final F which is translated to 4, which corresponds to Thursday. However, today is Monday, right?
The worst thing is that if I add four days to this date, I get the correct one 5 which is "Friday"
[15-10-26 18:19:50:012 CET] 2015-10-30 5
What's wrong with this code ?