---
sourceDocument: Referência de API do Xanadu
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - pt-BR

ft:publication_title :

    - Referência de API do Xanadu

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ICalUtilSNC - Global

# ICalUtilSNC - Global {#ariaid-title1}

A inclusão de script ICalUtilSNC fornece funções para gerar eventos compatíveis com iCalendar.

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

Gera um componente VCALENDAR formatado.
{#r_ICalUtilSNC-formatICalComponent_Array__table_jbj_csf_hx__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| eventosarr | Matriz | Propriedades que compõem um componente VCALENDAR. |
[Tabela 1. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| Matriz | Propriedades necessárias para formar um VCALENDAR. |
[Tabela 2. Retorna]

{#r_ICalUtilSNC-formatICalComponent_Array__table_kbj_csf_hx}

## ICalUtilSNC - formatICalEvent(arrEvent de matriz, useAlarm booliano) {#ariaid-title3}

Gera um VEVENT formatado.
{#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_qxl_5qf_hx__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| eventoarr | Matriz | Contém as propriedades individuais que compõem um VEVENT. |
| usarAlarme | Booliano | Se verdadeiro, adiciona um VALARM ao VEVENT. |
[Tabela 3. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| Cadeia de caracteres | O VEVENT. |
[Tabela 4. Retorna]

{#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_rxl_5qf_hx}

## ICalUtilSNC - formatRecurringRule (Obj de regra de objeto) {#ariaid-title4}

Formata a propriedade RRULE para um VEVENT.
{#r_ICalUtilSNC-formatRecurringRule_Object__table_gvv_spf_hx__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| ruleObj | Objeto | Contém as propriedades para a propriedade RRULE. |
[Tabela 5. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| Cadeia de caracteres | A propriedade RRULE formatada. |
[Tabela 6. Retorna]

{#r_ICalUtilSNC-formatRecurringRule_Object__table_hvv_spf_hx}

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

Retorna a data de GlideScheduleDateTime.
{#r_ICalUtilSNC-getDateFromScheduleDateTime_GSDT__table_uwx_3tf_hx__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| scheduleDateTime | GlideScheduleDateTime | Uma representação GlideScheduleDateTime da data e hora. |
[Tabela 7. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| Cadeia de caracteres | Data formatada. |
[Tabela 8. Retorna]

{#r_ICalUtilSNC-getDateFromScheduleDateTime_GSDT__table_vwx_3tf_hx}  

### Exemplo de cURL {#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);

Saída:

    2023-02-08 09:05:22
    20230208

## ICalUtilSNC -- getSDT(cadeia de caracteres sdtStr, cadeia de caracteres timeZone) {#ariaid-title6}

Retorna um objeto GlideScheduleDateTime com base na cadeia de caracteres de data e hora aprovada.
{#r_ICalUtilSNC-getSDT_String_String__table_ern_ksf_hx__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| sdtStr | Cadeia de caracteres | ScheduleDateTime formatado. |
| fuso horário | Cadeia de caracteres | Opcional. Fuso horário a ser usado ao gerar o objeto GlideScheduleDateTime. |
[Tabela 9. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| GlideScheduleDateTime | Uma representação GlideScheduleDateTime da cadeia de caracteres de data e hora aprovada. |
[Tabela 10. Retorna]

{#r_ICalUtilSNC-getSDT_String_String__table_frn_ksf_hx}

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

Retorna a hora de GlideScheduleDateTime.
{#r_ICalUtilSNC-getTimeFromScheduleDateTime_GSDT__table_trh_d5f_hx__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| scheduleDateTime | GlideScheduleDateTime | Uma representação GlideScheduleDateTime da data e hora. |
[Tabela 11. Parâmetros]

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

| Tipo | Descrição |
|-|-|
| Cadeia de caracteres | Hora formatada. |
[Tabela 12. Retorna]

{#r_ICalUtilSNC-getTimeFromScheduleDateTime_GSDT__table_urh_d5f_hx}  
O exemplo de código a seguir mostra como chamar este método.

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

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

Saída:

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


