In Apps Script, there are a few basic concepts when it comes to time zones.
- A script has its own independent time zone property. It does not share the time zone with either a user’s browser or a spreadsheet. A script’s time zone can be modified using the File > Properties menu in the Script Editor.
- A script executes in its own time zone context. Each script is guaranteed an execution environment that uses the script’s predefined time zone. For example, different scripts executing
var date = new Date();
may get different dates depending on the time zone of the respective script.
Stay tuned for part 2!
Saurabh Gupta, Google Developer Relations
Pretty amazing that I visited the Google Apps Script homepage to see if anybody else has had the same issue with time zones as I'm having right now.. and this happened to the be the first link at the top of the list! Anyway, good info. in here. Looking forward to part 2.
ReplyDeleteThank you. Your 9 year old blog post just saved me a lot of frustrating debug time. Stupid Daylight Savings.
ReplyDelete