--business hours in this example 8am-5pm:
var gdt=gs.nowDateTime();
var gdtArr= gdt.split(' ');
var timeArr=gdtArr[1].split(':');
//vat currenttime=parseInt(timeArr[0]);
gs.print(timeArr[0]);
if (timeArr[0]>=17 || timeArr[0]<8){
gs.print('out of hours');
}
var gdt=gs.nowDateTime();
var gdtArr= gdt.split(' ');
var timeArr=gdtArr[1].split(':');
//vat currenttime=parseInt(timeArr[0]);
gs.print(timeArr[0]);
if (timeArr[0]>=17 || timeArr[0]<8){
gs.print('out of hours');
}
Comments
Post a Comment