Working with Dates and Times

  • Google Ads scripts often require working with dates and times for tasks like reporting, scheduling, and logging.

  • JavaScript's built-in Date object represents a specific moment in time independent of any time zone.

  • Avoid using JavaScript Date object methods that assume a default time zone in Google Ads scripts, as the default is always America/Los_Angeles regardless of your account's time zone.

  • Use Utilities.formatDate() to format date objects for specific time zones and formats, and