- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2017 12:34 AM
Hi Chandresh,
I am not sure what is the purpose of these codes, when you are doing the same thing is datetime vaiable
var dateArr = str.split(' ');
var date = dateArr[0];
var time= dateArr[1];
var datetime= date+' '+time;
Can you just try this and check if it helps.
var gr=new GlideRecord("sn_customerservice_case_staging");
gr.addQuery('u_case','f4235c63db87b6003f7d388ffe961965');
gr.query();
while(gr.next()){
var str= gr.u_time_stamp;
//var gdt = new GlideDateTime(str);
var tz = gs.getSession().getTimeZone();
gs.print(str.setTZ(tz));
}
setTZ(tz) : http://wiki.servicenow.com/index.php?title=GlideDateTime#setTZ.28tz.29
Sets the time zone of the GlideDateTime object to be the specified time zone.
Also, just to trouble the issue please check if it works.
var tz = gs.getSession().getTimeZone();
var gdt = new GlideDateTime();
gdt.setTZ(tz)