Event Create Dates Issue GlideScheduleDateTime();

basantsoni
Kilo Guru

Hi Friends,

Need your help, We are creating events from Script in My Calendars and passing start and end date with the help of API’s new GlideScheduleDateTime();. But we are facing some issue. Events are getting created but what time we are giving it’s getting created in different times like 2 hours or 4 hours before as per given.

How events will be created in same time whatever we are giving.

Thanks, Basant

1 REPLY 1

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Dates are always so much fun because of all the varying time zones and formatting.  Are you also setting the timezone with your GlideScheduleDateTime() API call?  I learn best by looking at examples and if you search your instance's Script Includes where script contains GlideScheduleDateTime you will find several.  I am looked at FormattedScheduleReport Script Include as an example and line 76 you will see that you can call the GlideScheduleDateTime().setTimeZone() function.

 

Please mark this post as helpful or the correct answer to your question if applicable so others viewing may benefit.