A colleague of mine has written a Google Apps script to automate a workflow (approving room comp requests at a hotel). The script, by and large, seems to be functioning as
I had a similar problem but mine was from entering the date in a form in the format MM/dd/yyy. When getting the date from the spreadsheet to post to an email, it was always one day less.
I'm in Eastern time (GMT-5:00). I verified that it was correct in my Project properties and my Spreadsheet setting. After digging deeper, I realized that although the date entered in the form and displayed in the spreadsheet was 7/27/2012 the actual date in the spreadsheet was:
Thu Jul 26 21:00:00 PDT 2012
This made "some" sense, as 7/27/2012 00:00:00 Eastern Time (GMT-5:00) would be the day before in PDT by three hours. I simply formatted the date GMT. I could have formatted it to EDT, and it should have always worked, but hard coding it GMT more or less took the guessing out of someone else reading the code if the code would need to be changed as the seasons changed. I only needed the date.
I did copy and paste the FUS1 example in this post (for now as comments) as a more "eloquent" way of handling the problem. Thanks!