How to convert this: 20220831T000000Z into a date time

Community Alums
Not applicable

How to convert this: 20220831T000000Z into a date time

5 REPLIES 5

-O-
Kilo Patron
Kilo Patron

You can also parse this format with help of GlideDateTime:

var $gdt = new GlideDateTime();
$gdt.setDisplayValue("20220831T000000Z", "yyyyMMdd'T'HHmmssX");
gs.debug($gdt.getValue());

 

This run in Scripts - Background prints:

*** Script: [DEBUG] 2022-08-31 00:00:00