How to convert local time to system time?

kiki330611
Kilo Expert

Hi Guys,

I have a GlideRecord script similar to below:

=====

var gr = new GlideRecord('incident');

gr.addQuery('sys_created_on', '>', Date)

.....

=====

The Date variable will come from an api call as a parameter sent by the client. Basically they want to know how many records were created at a certain range of dates. But they will send the date/time in their local time. How do I convert their local time to ServiceNow's system time (UTC) so I can put that date into the addQuery?

Many thanks!