Search code examples
javascriptfirebasegoogle-cloud-functionstimezonetimezone-offset

How to set the time zone in Google Cloud Functions?


How do I set the runtime time zone in Google Cloud Functions in JavaScript? I mean not in a specific Date object, but globally.

By default, calling Intl.DateTimeFormat().resolvedOptions().timeZone returns UTC and calling new Date().getTimezoneOffset() returns 0.

How do I configure GCF or how do I update the runtime environment so that Intl.DateTimeFormat().resolvedOptions().timeZone returns Europe/Berlin and calling new Date().getTimezoneOffset() returns -120?


Solution

  • It's not possible to configure the timezone on a Cloud Functions server instance.