This is a sample script for opening and closing Google Forms on time using Google Apps Script.
Here’s a handy little snippet if you would like to programmatically open/close one of your Google Forms to responses for specific hours of the day. The script includes another trigger that will repeat opening/closing the Google Form for responses each day. As this snippet uses .timeBased().at(date)
it’s easy for you to modify if you want to only have the form open to responses between two specific dates/times.
Source: Opening and Closing Google Forms on Time using Google Apps Script
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.