[Google Apps Script] Create an event in Google Calendar

Created on November 30, 2026

You can call createEvent() on a calendar returned by CalendarApp.getCalendarById(). Replace the example ID with a calendar you can edit. This example schedules a planning meeting from noon to 1 p.m. in Japan Standard Time on June 15, 2027.

function createPlanningMeeting() {
  const calendar = CalendarApp.getCalendarById("YOUR_CALENDAR_ID");
  if (!calendar) {
    throw new Error("Calendar not found or inaccessible.");
  }

  calendar.createEvent(
    "Planning meeting",
    new Date("2027-06-15T12:00:00+09:00"),
    new Date("2027-06-15T13:00:00+09:00")
  );
}

Pass the title, start time, and end time in that order. The +09:00 offset specifies the two instants regardless of the script's default time zone.

Google Apps Script