I have a Scheduled Cloud Function (using Google's new solution) that is meant to run every Monday at 12:00am.
export const updateHighScores = functions.pubsub.schedule('0 0 * * 1').onRun((context) => {
// (code)
// console.log(‘This code will run every Monday at 12:00 AM UTC’);
});
I was expecting it to run at 12:00am UTC; however, when midnight UTC rolled around, nothing happened. So I went to bed, saddened that my scheduled cloud function didn't work, but determined to keep working at it.
But the next day I checked the logs, and it appears it did work, but it ran at 12:00am Pacific time instead.
- The Cloud Function's region is set to us-central1, but I don't think that affects this.
- My computer's time zone is set to Pacific time and I'm located in central time, but I wouldn't think either would matter.
- I also clicked around in Firebase and Google Cloud Platform to see if maybe I had a setting that was affecting it, but didn't find anything.
Any idea why this ran at midnight Pacific time rather than UTC?
(I'm going to do a bunch of guess-and-checking by changing all these variables and observing how it affects the scheduled cloud function, but figured might as well ask here in case someone knows off the top of their head. Thanks!)