Is it possible to use gs. method to get the date and time in standard time?

Rain Vaine
Kilo Sage

Hello experts,

I tried calling an event in a scheduled job and I need to pass a date in the event parameter. 

find_real_file.png

I have come across a method and I was able to pass the date in the parameter and use it in the email content of the notification.

find_real_file.png

It is working and sending in my email.

find_real_file.png

My problem now is that the time is sent in the UTC format, do you know of any method that returns in JST? or japan standard time?

Thanks in advance

 

1 ACCEPTED SOLUTION

Hello,

Thanks for the suggestion but it is not the exact thing I am looking for. But in the end I was able to find it either by using the getDisplayValue(); for GlideDateTime constructor or the gs.nowDateTime(); method.

find_real_file.png

Regards,

Rain

View solution in original post

3 REPLIES 3

MrMuhammad
Giga Sage

Hi @Rain Vaine,

You can try below to get time in the system timezone [I assume it would be JST]. Add below as the third paramter.

new GlideDateTime();

If you want to get the user's local time then try below.

var gdt = new GlideDateTime();

var timeNow = gdt.getLocalTime(); 

gs.eventQueue('totalMemoryWarning', current, freeMem, timeNow);

Regards,

Muhammad

Regards,
Muhammad

@Rain Vaine - Is it resolved? If so, please mark the above response as correct and close the thread to help future readers.

Thanks and have a nice one 🙂

Regards,
Muhammad

Hello,

Thanks for the suggestion but it is not the exact thing I am looking for. But in the end I was able to find it either by using the getDisplayValue(); for GlideDateTime constructor or the gs.nowDateTime(); method.

find_real_file.png

Regards,

Rain