0
votes

I always have this confusion, since I assume the app scripts are code running on google servers located in california.

However, I had run as methods (doGet/ doPost) after a web deployment. It gives me my locale date. (https://script.google.com/macros/s/AKfycbxhzHRji1XLgmOJL1hJ9MZJVDsWSHm2errtakBn8OORmn2MTt0/exec). Not sure if this is exactly my os date.

Is this value likely to change for any reason such as the request being load balanced? How is it getting the date of my locale?

1
date values are always stored as milliseconds since epoch UTC - what is displayed depends on how you display it. Also, what timezone is used depends on the arguments passed to new Date - read some documentationJaromanda X
Was my answer useful for you? If you have problems for my answer yet, feel free to tell me. I would like to study to solve your problems.Tanaike
@Tanaike, it was exactly what I needed, thanks.deostroll
I'm glad your problem was solved. Thank you, too.Tanaike

1 Answers

0
votes

When you deploy Web Apps, if you set "Execute the app as:" to "Me" and "Who has access to the app:" to "Anyone, even anonymous", the script of Web Apps is run as the owner that in your case, it's you. So your time zone is always used.

If you want to use user's each time zone, please set "Me" and "Anyone" for "Execute the app as:" and "Who has access to the app:", respectively. By this, when users access the URL of Web Apps, the login screen is displayed. When users login by own account, the user's time zone is used.

If I misunderstand your question, I'm sorry.