---
sourceDocument: Référence de l’API Xanadu
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/fr-FR/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - fr-FR

ft:publication_title :

    - Référence de l’API Xanadu

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ICalUtilSNC - Global

# ICalUtilSNC - Global {#ariaid-title1}

L'include de script ICalUtilSNC fournit des fonctions permettant de générer des événements compatibles iCalendar.

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

Génère un composant VCALENDAR formaté.
{#r_ICalUtilSNC-formatICalComponent_Array__table_jbj_csf_hx__entry__3}

| Nom | Type | Description |
|-|-|-|
| arrÉvénements | Tableau | Propriétés qui composent un composant VCALENDAR. |
[Tableau 1. Paramètres]

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

| Type | Description |
|-|-|
| Tableau | Propriétés nécessaires pour former un VCALENDAR. |
[Tableau 2. Renvoie]

{#r_ICalUtilSNC-formatICalComponent_Array__table_kbj_csf_hx}

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

Génère un VEVENT formaté.
{#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_qxl_5qf_hx__entry__3}

| Nom | Type | Description |
|-|-|-|
| arrEvent | Tableau | Contient les propriétés individuelles qui composent un VEVENT. |
| useAlarme | Booléen | Si vrai, ajoute une VALARM au VEVENT. |
[Tableau 3. Paramètres]

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

| Type | Description |
|-|-|
| Chaîne | Le VEVENT formaté. |
[Tableau 4. Renvoie]

{#r_ICalUtilSNC-formatICalEvent_Array_Boolean__table_rxl_5qf_hx}

## ICalUtilSNC : formatRecurringRule (objet ruleObj) {#ariaid-title4}

Met en forme la propriété RRULE pour un VEVENT.
{#r_ICalUtilSNC-formatRecurringRule_Object__table_gvv_spf_hx__entry__3}

| Nom | Type | Description |
|-|-|-|
| ruleObj | Objet | Contient les propriétés de la propriété RRULE. |
[Tableau 5. Paramètres]

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

| Type | Description |
|-|-|
| Chaîne | La propriété RRULE formatée. |
[Tableau 6. Renvoie]

{#r_ICalUtilSNC-formatRecurringRule_Object__table_hvv_spf_hx}

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

Renvoie la date à partir de GlideScheduleDateTime.
{#r_ICalUtilSNC-getDateFromScheduleDateTime_GSDT__table_uwx_3tf_hx__entry__3}

| Nom | Type | Description |
|-|-|-|
| scheduleDateTime | GlideScheduleDateTime | Représentation GlideScheduleDateTime de la date et de l'heure. |
[Tableau 7. Paramètres]

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

| Type | Description |
|-|-|
| Chaîne | Date formatée. |
[Tableau 8. Renvoie]

{#r_ICalUtilSNC-getDateFromScheduleDateTime_GSDT__table_vwx_3tf_hx}  

### Exemple 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);

Sortie :

    2023-02-08 09:05:22
    20230208

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

Renvoie un objet GlideScheduleDateTime en fonction de la chaîne de date et d'heure transmise.
{#r_ICalUtilSNC-getSDT_String_String__table_ern_ksf_hx__entry__3}

| Nom | Type | Description |
|-|-|-|
| sdtStr | Chaîne | ScheduleDateTime formaté. |
| Fuseau horaire | Chaîne | Facultatif. Fuseau horaire à utiliser lors de la génération de l'objet GlideScheduleDateTime. |
[Tableau 9. Paramètres]

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

| Type | Description |
|-|-|
| GlideScheduleDateTime | Représentation GlideScheduleDateTime de la chaîne de date et d'heure transmise. |
[Tableau 10. Renvoie]

{#r_ICalUtilSNC-getSDT_String_String__table_frn_ksf_hx}

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

Renvoie l'heure à partir de GlideScheduleDateTime.
{#r_ICalUtilSNC-getTimeFromScheduleDateTime_GSDT__table_trh_d5f_hx__entry__3}

| Nom | Type | Description |
|-|-|-|
| scheduleDateTime | GlideScheduleDateTime | Représentation GlideScheduleDateTime de la date et de l'heure. |
[Tableau 11. Paramètres]

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

| Type | Description |
|-|-|
| Chaîne | Heure formatée. |
[Tableau 12. Renvoie]

{#r_ICalUtilSNC-getTimeFromScheduleDateTime_GSDT__table_urh_d5f_hx}  
L'exemple de code suivant montre comment appeler cette méthode.

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

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

Sortie :

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


