Ask Your Question
3

What is the method for specifying a particular time zone in a Scheduled Cloud Function?

asked 2023-05-29 00:53:44 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-05-29 01:09:02 +0000

lalupa gravatar image

To specify a particular time zone in a Scheduled Cloud Function, you can use the timeZone parameter when configuring the schedule. This parameter accepts a string value that represents the time zone in the format of Area/Location such as "America/New_York" or "Asia/Tokyo".

For example, to schedule a function to run every day at 9:00 AM EST, you can set the timeZone parameter to "America/New_York" as follows:

exports.scheduledFunction = functions.pubsub.schedule('every day 09:00').timeZone('America/New_York').onRun((context) => {
  console.log('This will be run every day at 9:00 AM EST!');
});
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-29 00:53:44 +0000

Seen: 12 times

Last updated: May 29 '23