Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

tiagomacul
Giga Sage

Exemplo query por data

var ObjDate = new GlideDateTime();  

ObjDate.addSeconds(60);

var dt = ObjDate.getDisplayValue();  

gs.print(dt);  

var Obj = new GlideRecord("u_minha_tabela");    

Obj.addQuery('sys_created_on','<',ObjDate);s

Obj.orderByDesc('sys_created_on');      

Obj.query();  

  while(Obj.next()){

gs.print(Obj.sys_created_on);

}

GlideRecord

Scripts::. Exemplo como adicionar tempo/segundos a uma data?

Scripts::. Exemplo como separar dia, mês e ano de uma data

Scripts::. Exemplo Como pegar a data e hora atual