google script get date code example
Example 1: google script get date without time
setValue(new Date(new Date().setHours(0,0,0,0))).setNumberFormat('MM/dd/yyyy');
Example 2: google script new date
// Create a date object for the current date and time.
var now = new Date();
// Create a date object for a past date and time using a formatted string.
var date = new Date('February 17, 2018 13:00:00 -0500');
// Create a copy of an existing date object.
var copy = new Date(date);