If you looking for solution where you want to close delivery for the day if it crosses certain time period, then you can use below code.


var today1 = new Date();

var today = new Date ( today1 );

today.setHours ( today1.getHours() + 18); 18(in hours) here indicates to shift time by 18 hours. 

var dd = today.getDate();

var mm = today.getMonth()+1; //January is 0!

var yy = today.getYear() - 100;

if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} today = mm+'/'+dd+'/'+yy;