I wanted to compare the date and time in a column which the current date and time. if Date+time in column is future than it should log the array number (see code below)
But, Following script giving random answer.
function datecompare() {
var fms = SpreadsheetApp.getActive().getSheetByName('FMS');
var now = new Date();
var rangePl = fms.getRange(1,1,10);
var valuePl = rangePl.getValues();
for (var i=0; i<10; i++)
{ if (valuePl[i] > now) { Logger.log(i) ;}// This should log the when value is greater than current time
}
}