How to convert iso date string (2015-11-18T20:00:00Z) to local time

Bhargava4
Mega Expert

How to convert iso date string (2015-11-18T20:00:00Z) to local time

6 REPLIES 6

HV1
Mega Guru

You can use getLocalTime() method of GlideDateTime to get the time in user's local timezone.


GlideDateTime - ServiceNow Wiki



var gdt = new GlideDateTime("2011-08-31 08:00:00");


gs.print(gdt.getLocalTime());



Regards,


Hardik Vora


  Hardik, Thanks you are replay


i get the date value JSON date string , In Snow it shows only date how to get date and time Capture.PNG


What is the data type of those columns in table?


Bhargava4
Mega Expert

Data type is date/time  


i got REST API output JSON format , i am using schedule job for push data in to table ,