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

 Release :

    - brazil

ft:locale :

    - pt-BR

ft:publication_title :

    - Referência de API do Brasil

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(matriz arrEvents) {#ariaid-title2}

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

| Nome | Tipo | Descrição |
|-|-|-|
| ArrEvents | 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(Array arrEvent, boolian useAlarm) {#ariaid-title3}

Gera um VEVENT formatado.
{#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_qxl_5qf_hx__entry__3}

| Nome | Tipo | Descrição |
|-|-|-|
| ArrEvent | Matriz | Contém as propriedades individuais que compõem um VEVENT. |
| Alarme de uso | 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 formatado. |
[Tabela 4. Retorna]

{#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_rxl_5qf_hx}

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

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

| Nome | Tipo | Descrição |
|-|-|-|
| Obj de regra | Object | Contém as propriedades da 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, fuso horário da cadeia de caracteres) {#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 passadas. |
[Tabela 10. Retorna]

{#r_ICalUtilSNC-getSDT_String_String__table_frn_ksf_hx}

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

Retorna a hora do 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


