Skip to content

Instantly share code, notes, and snippets.

View niddhogg's full-sized avatar

Дученчук Володимир niddhogg

View GitHub Profile
// backup service
function makeCopy() {
// generates the timestamp and stores in variable formattedDate as year-month-date hour-minute-second
var timeZone = Session.getScriptTimeZone();
var formattedDate = Utilities.formatDate(new Date(), timeZone, "yyyy-MM-dd' 'HH:mm:ss");
// gets the name of the original file and appends the word "copy" followed by the timestamp stored in formattedDate
var name = SpreadsheetApp.getActiveSpreadsheet().getName() + " Copy " + formattedDate;