---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ICalUtilSNC - Global

# ICalUtilSNC - Global {#ariaid-title1}

The ICalUtilSNC script include provides functions to generate iCalendar compliant events.

## ICalUtilSNC - formatICalComponent(Array arrEvents) {#ariaid-title2}

Generates a formatted VCALENDAR component.
{#r_ICalUtilSNC-formatICalComponent_Array__table_jbj_csf_hx__entry__3}

| Name | Type | Description |
|-|-|-|
| arrEvents | Array | Properties that make up a VCALENDAR component. |
[Table 1. Parameters]

{#r_ICalUtilSNC-formatICalComponent_Array__table_jbj_csf_hx} {#r_ICalUtilSNC-formatICalComponent_Array__table_kbj_csf_hx__entry__2}

| Type | Description |
|-|-|
| Array | Properties needed to form a VCALENDAR. |
[Table 2. Returns]

{#r_ICalUtilSNC-formatICalComponent_Array__table_kbj_csf_hx}

## ICalUtilSNC - formatICalEvent(Array arrEvent, Boolean useAlarm) {#ariaid-title3}

Generates a formatted VEVENT.
{#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_qxl_5qf_hx__entry__3}

| Name | Type | Description |
|-|-|-|
| arrEvent | Array | Contains the individual properties that make up a VEVENT. |
| useAlarm | Boolean | If true, adds a VALARM to the VEVENT. |
[Table 3. Parameters]

{#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_qxl_5qf_hx} {#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_rxl_5qf_hx__entry__2}

| Type | Description |
|-|-|
| String | The formatted VEVENT. |
[Table 4. Returns]

{#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_rxl_5qf_hx}

## ICalUtilSNC - formatRecurringRule (Object ruleObj) {#ariaid-title4}

Formats the RRULE property for a VEVENT.
{#r_ICalUtilSNC-formatRecurringRule_Object__table_gvv_spf_hx__entry__3}

| Name | Type | Description |
|-|-|-|
| ruleObj | Object | Contains the properties for the RRULE property. |
[Table 5. Parameters]

{#r_ICalUtilSNC-formatRecurringRule_Object__table_gvv_spf_hx} {#r_ICalUtilSNC-formatRecurringRule_Object__table_hvv_spf_hx__entry__2}

| Type | Description |
|-|-|
| String | The formatted RRULE property. |
[Table 6. Returns]

{#r_ICalUtilSNC-formatRecurringRule_Object__table_hvv_spf_hx}

## ICalUtilSNC - getDateFromScheduleDateTime (GlideScheduleDateTime scheduleDateTime) {#ariaid-title5}

Returns the date from the GlideScheduleDateTime.
{#r_ICalUtilSNC-getDateFromScheduleDateTime_GSDT__table_uwx_3tf_hx__entry__3}

| Name | Type | Description |
|-|-|-|
| scheduleDateTime | GlideScheduleDateTime | A GlideScheduleDateTime representation of the date and time. |
[Table 7. Parameters]

{#r_ICalUtilSNC-getDateFromScheduleDateTime_GSDT__table_uwx_3tf_hx} {#r_ICalUtilSNC-getDateFromScheduleDateTime_GSDT__table_vwx_3tf_hx__entry__2}

| Type | Description |
|-|-|
| String | Formatted date. |
[Table 8. Returns]

{#r_ICalUtilSNC-getDateFromScheduleDateTime_GSDT__table_vwx_3tf_hx}  

### cURL example {#r_ICalUtilSNC-getDateFromScheduleDateTime_GSDT__example_ccl_h3f_lwb}

    var scheduleDateTime = new GlideScheduleDateTime();
    var myICalUtilSNC = new ICalUtilSNC();
    var scheduleDate = myICalUtilSNC.getDateFromScheduleDateTime(scheduleDateTime);

    gs.info(scheduleDateTime);
    gs.info(scheduleDate);

Output:

    2023-02-08 09:05:22
    20230208

## ICalUtilSNC - getSDT(String sdtStr, String timeZone) {#ariaid-title6}

Returns a GlideScheduleDateTime object based on the passed date and time string.
{#r_ICalUtilSNC-getSDT_String_String__table_ern_ksf_hx__entry__3}

| Name | Type | Description |
|-|-|-|
| sdtStr | String | Formatted ScheduleDateTime. |
| timeZone | String | Optional. Time zone to use when generating the GlideScheduleDateTime object. |
[Table 9. Parameters]

{#r_ICalUtilSNC-getSDT_String_String__table_ern_ksf_hx} {#r_ICalUtilSNC-getSDT_String_String__table_frn_ksf_hx__entry__2}

| Type | Description |
|-|-|
| GlideScheduleDateTime | A GlideScheduleDateTime representation of the passed date and time string. |
[Table 10. Returns]

{#r_ICalUtilSNC-getSDT_String_String__table_frn_ksf_hx}

## ICalUtilSNC - getTimeFromScheduleDateTime (GlideScheduleDateTime scheduleDateTime) {#ariaid-title7}

Returns the time from the GlideScheduleDateTime.
{#r_ICalUtilSNC-getTimeFromScheduleDateTime_GSDT__table_trh_d5f_hx__entry__3}

| Name | Type | Description |
|-|-|-|
| scheduleDateTime | GlideScheduleDateTime | A GlideScheduleDateTime representation of the date and time. |
[Table 11. Parameters]

{#r_ICalUtilSNC-getTimeFromScheduleDateTime_GSDT__table_trh_d5f_hx} {#r_ICalUtilSNC-getTimeFromScheduleDateTime_GSDT__table_urh_d5f_hx__entry__2}

| Type | Description |
|-|-|
| String | Formatted time. |
[Table 12. Returns]

{#r_ICalUtilSNC-getTimeFromScheduleDateTime_GSDT__table_urh_d5f_hx}  
The following code example shows how to call this method.

    var scheduleDateTime = new GlideScheduleDateTime();
    var myICalUtilSNC = new ICalUtilSNC();
    var scheduleDate = myICalUtilSNC.getTimeFromScheduleDateTime(scheduleDateTime);

    gs.info(scheduleDateTime);
    gs.info(scheduleDate);

Output:

    2023-02-08 10:21:43
    102143Z


