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.

How to convert this start date time format "20241226T000000" into "2024-12-26 00:00:00".

shashanksha
Tera Contributor

How to convert this start date time format "20241226T000000" into "2024-12-26 00:00:00". this format as i need to compare this to current planned start time. Could you please help me out over this.

1 REPLY 1

Shruti
Mega Sage
Mega Sage
var gdt = new GlideDateTime();
gdt.setDisplayValue("20241226T000000", "yyyyMMdd'T'HHmmss");
gs.info(gdt.getDisplayValueInternal());