Use of GlideDateTime in eval script of a pattern

thomasbueck
Giga Contributor

Hi,

 

I need to transform timestamps into dates.

I try to use GlideDateTime in an EVAL script during table transformation, but I'm always getting an error.

 

Does anyone know, if it's in general supported, I couldn't find it documented and in the EVAL script examples kb article is no reference/ use of GlideDateTime.

 

Thanks for your support in advance

 

Thomas

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@thomasbueck 

share your script here

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

thomasbueck
Giga Contributor

That's the script:

set_field {
field_name = "first_hit"
value = eval {"javascript: var intValue= ${panorama_firewall_policies[].first_hit};
intValue=intValue*1000; 
var gdt = new GlideDateTime();
var rtrn = gdt.setValue(intValue);
rtrn;"}
}