Google Apps Script(GAS)では、日付から曜日を特定するだけではなく日本の祝日も特定できます。 通常のプログラミング言語では曜日を示す番号を取得するだけしかできず、祝日を特定したい場合は別途独自でデータを与える必要がありますが、GASの場合はGoogleカレンダーと連携して祝日取得が可能なのです。 [ad#top-1] まずは土日を特定する方法 まず最初に土日を特定する方法についてです。 DateオブジェクトのgetDay()メソッドを使うと曜日を示す番号を取得できます。土曜日は6で日曜日は0になるのでそれを検知すれば土日を検知できます。ここまでは至って普通の機能です。 var dt = new Date(); //土曜日は6, 日曜日は0 if(dt.getDay() == 0 || dt.getDay() == 6){ //ここで処理 } 日本の祝日を特定する方法 次