{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1047,"path":"api-reference/server-api-reference/c_ICalUtilSNCAPI.md","title":"ICalUtilSNC - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# ICalUtilSNC- Global\n\nThe ICalUtilSNC script include provides functions to generate iCalendar compliant events.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## ICalUtilSNC - formatICalComponent\\(Array arrEvents\\)\n\nGenerates a formatted VCALENDAR component.\n\n|Name|Type|Description|\n|----|----|-----------|\n|arrEvents|Array|Properties that make up a VCALENDAR component.|\n\n|Type|Description|\n|----|-----------|\n|Array|Properties needed to form a VCALENDAR.|\n\n## ICalUtilSNC - formatICalEvent\\(Array arrEvent, Boolean useAlarm\\)\n\nGenerates a formatted VEVENT.\n\n|Name|Type|Description|\n|----|----|-----------|\n|arrEvent|Array|Contains the individual properties that make up a VEVENT.|\n|useAlarm|Boolean|If true, adds a VALARM to the VEVENT.|\n\n|Type|Description|\n|----|-----------|\n|String|The formatted VEVENT.|\n\n## ICalUtilSNC - formatRecurringRule \\(Object ruleObj\\)\n\nFormats the RRULE property for a VEVENT.\n\n|Name|Type|Description|\n|----|----|-----------|\n|ruleObj|Object|Contains the properties for the RRULE property.|\n\n|Type|Description|\n|----|-----------|\n|String|The formatted RRULE property.|\n\n## ICalUtilSNC - getDateFromScheduleDateTime \\(GlideScheduleDateTime scheduleDateTime\\)\n\nReturns the date from the GlideScheduleDateTime.\n\n|Name|Type|Description|\n|----|----|-----------|\n|scheduleDateTime|GlideScheduleDateTime|A GlideScheduleDateTime representation of the date and time.|\n\n|Type|Description|\n|----|-----------|\n|String|Formatted date.|\n\n### cURL example\n\n```\nvar scheduleDateTime = new GlideScheduleDateTime();\nvar myICalUtilSNC = new ICalUtilSNC();\nvar scheduleDate = myICalUtilSNC.getDateFromScheduleDateTime(scheduleDateTime);\n\ngs.info(scheduleDateTime);\ngs.info(scheduleDate);\n```\n\nOutput:\n\n```\n2023-02-08 09:05:22\n20230208\n```\n\n## ICalUtilSNC - getSDT\\(String sdtStr, String timeZone\\)\n\nReturns a GlideScheduleDateTime object based on the passed date and time string.\n\n|Name|Type|Description|\n|----|----|-----------|\n|sdtStr|String|Formatted ScheduleDateTime.|\n|timeZone|String|Optional. Time zone to use when generating the GlideScheduleDateTime object.|\n\n|Type|Description|\n|----|-----------|\n|GlideScheduleDateTime|A GlideScheduleDateTime representation of the passed date and time string.|\n\n## ICalUtilSNC - getTimeFromScheduleDateTime \\(GlideScheduleDateTime scheduleDateTime\\)\n\nReturns the time from the GlideScheduleDateTime.\n\n|Name|Type|Description|\n|----|----|-----------|\n|scheduleDateTime|GlideScheduleDateTime|A GlideScheduleDateTime representation of the date and time.|\n\n|Type|Description|\n|----|-----------|\n|String|Formatted time.|\n\nThe following code example shows how to call this method.\n\n```\nvar scheduleDateTime = new GlideScheduleDateTime();\nvar myICalUtilSNC = new ICalUtilSNC();\nvar scheduleDate = myICalUtilSNC.getTimeFromScheduleDateTime(scheduleDateTime);\n\ngs.info(scheduleDateTime);\ngs.info(scheduleDate);\n```\n\nOutput:\n\n```\n2023-02-08 10:21:43\n102143Z\n```\n\n"}}