Hi dear Apps Script wizards,
New Apps Scripter here, please be indulgent.
I want to get files uploaded in a Google Drive folder in the last 24 hours.
I would need to get the created date but all I can get for now is the modified date...
Anyone here able to help on this?
You can find my code below.
Many thanks
var oneDaysBeforeNow = new Date().getTime()-3600*1000*24;
var cutOffDate = new Date(oneDaysBeforeNow);
var cutOffDateAsString = Utilities.formatDate(cutOffDate, "GMT", "yyyy-MM-dd");
var folderId = "1Ogrcfp_lbU4h4xhobLaWqvT0N55w-Ijy";
var files = DriveApp.getFolderById(folderId).searchFiles('modifiedDate > "' + cutOffDateAsString + '"');
// var files = DriveApp.getFolderById(folderId).searchFiles('createdDate > "' + cutOffDateAsString + '"');