# Workflow - Date/Time Formatter Action

> With the Date/Time Formatter action, you can reformat the Date or Date and Time as required. You can also compare dates using the action.

- Source: https://docs.ghlcustomercare.com/docs/saas-configurator/saas-mode/workflow-date-time-formatter-action
- Section: SaaS Configurator / Saas Mode
- Reading time: 3 min
- Images: 14, each explained below
- Modified on Tue, 16 Jan, 2024 at 4:49 AM

---
With the Date/Time Formatter action, you can reformat the Date or Date and Time as per your requirement. You can also compare dates using the action.

**TABLE OF CONTENTS**

-   Format Date
-   Format Date and Time
-   Compare Dates

![Figure 1](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293485600/original/mQC3q6W5GkDW_Um06RXgC_HIQuOXyamprA.png)

**Figure 1**

This screenshot appears in "Workflow - Date/Time Formatter Action". The text alongside this image reads: Format Date Format Date and Time Compare Dates. This part of the guide covers 3 fields, listed below. Immediately after, the guide continues: Select any date field. You can select a Specific Date, or Current Date, from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even Inbound Webhook Trigger.
- What this covers: Format Date Format Date and Time Compare Dates
- Fields: Format Date, Format Date and Time, Compare Dates
- Controls: TABLE OF CONTENTS
- Next: Select any date field. You can select a Specific Date, or Current Date, from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even Inbound Webhook Trigger.

Full procedure:

1. Format Date
2. Format Date and Time
3. Compare Dates

---

## **How to Format a Date**

### To convert date structure from one format to another.  
**Field:**

Select any date field. You can select a Specific Date, or Current Date, from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even Inbound Webhook Trigger.

### 

![From Format: (image 2 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293499588/original/_1utIHUqHXOqAPs92BiTwpZww4BQsBrujQ.png)

**From Format: (image 2 of 14)**

This screenshot appears in the "From Format:" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Select any date field. You can select a Specific Date, or Current Date, from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even Inbound Webhook Trigger. Immediately after, the guide continues: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom….
- What to fill in: Select any date field. You can select a Specific Date, or Current Date, from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even Inbound Webhook Trigger.
- Next: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.

**From Format:**

Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.

#### 

![From Format: (image 3 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293500391/original/1Kd6PUZXtT4AOQFWbBLkT2LOImgrmYP82g.png)

**From Format: (image 3 of 14)**

This screenshot appears in the "From Format:" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to….
- What to fill in: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.

### **To Format:**

#### Select the required format from the list

![Select the required format from the list (image 4 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293500697/original/Dlds7-wpcq09sncoJ5Yj3LJkGMkityYRNw.png)

**Select the required format from the list (image 4 of 14)**

This screenshot appears in the "Select the required format from the list" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to…. Immediately after, the guide continues: To convert date and time structure from one format to another.
- What to fill in: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.
- Next: To convert date and time structure from one format to another

### **Output**

#### After setting up the Format Date, you can use the results in further actions in your Workflow {{datetime\_formatter.1.date}}

#### Custom Values

### 

![Custom Values (image 5 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293485199/original/i57GTs9YqhKeBH6jHV9SZ8b70o9BHxFqhA.png)

**Custom Values (image 5 of 14)**

This screenshot appears in the "Custom Values" section of "Workflow - Date/Time Formatter Action". For context, this section explains: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to…. Immediately after, the guide continues: To convert date and time structure from one format to another.
- Next: To convert date and time structure from one format to another

---

## **Format Date and Time**

To convert date and time structure from one format to another

### **Field:**

Select any date-time field; you can select a Specific Date and Time, Current Date and Time, Appointment start or end date time, Custom values, or even from Inbound Webhook Trigger.

**Please note:**

Currently, Contact Custom fields do not support the Date Time structure.

![Field: (image 6 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293501865/original/vobWnYp1Evzld6XXk5ZHrhnEfHKOqONeag.png)

**Field: (image 6 of 14)**

This screenshot appears in the "Field:" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Currently, Contact Custom fields do not support the Date Time structure. Immediately after, the guide continues: Selecting any system fields like Specific Date and Time, Current Date and Time, Contact fields, or Appointment start or end date time will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook….
- What this covers: Currently, Contact Custom fields do not support the Date Time structure.
- Next: Selecting any system fields like Specific Date and Time, Current Date and Time, Contact fields, or Appointment start or end date time will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.

### **From Format:**

Selecting any system fields like Specific Date and Time, Current Date and Time, Contact fields, or Appointment start or end date time will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.

![From Format: (image 7 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293485200/original/ADCn7ZI9KM1XNRCewnqcX2MQFhLod3cGOA.png)

**From Format: (image 7 of 14)**

This screenshot appears in the "From Format:" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Selecting any system fields like Specific Date and Time, Current Date and Time, Contact fields, or Appointment start or end date time will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format. Immediately after, the guide continues: Select the required format from the list.
- What to choose: Selecting any system fields like Specific Date and Time, Current Date and Time, Contact fields, or Appointment start or end date time will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.
- Next: Select the required format from the list

### **To Format:**

Select the required format from the list

![To Format: (image 8 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293502392/original/Hx6KmKS9a_LsIT3YPR28n1I5snd_5T-VHQ.png)

**To Format: (image 8 of 14)**

This screenshot appears in the "To Format:" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Select the required format from the list. Immediately after, the guide continues: After setting up the Format Date and Time, you can use the results in further actions in your Workflow.
- What to choose: Select the required format from the list
- Next: After setting up the Format Date and Time, you can use the results in further actions in your Workflow.

### **Output**

After setting up the Format Date and Time, you can use the results in further actions in your Workflow.

{{datetime\_formatter.1.datetime}}

Custom Values

![Output (image 9 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293502719/original/RafxrtJSJwOrKgFMTiiXu_QDJ3l8oFEzQQ.png)

**Output (image 9 of 14)**

This screenshot appears in the "Output" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: {{datetime_formatter.1.datetime}}. For context, this section explains: After setting up the Format Date and Time, you can use the results in further actions in your Workflow. Immediately after, the guide continues: Compare two dates and get the difference in the number of days.
- What this covers: {{datetime_formatter.1.datetime}}
- Next: Compare two dates and get the difference in the number of days

---

## **Compare Dates**

Compare two dates and get the difference in the number of days

### **Start Date:**

Select any date field. You can select a Specific Date, or Current Date, from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even from Inbound Webhook Trigger.

![Start Date: (image 10 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293485206/original/pu4iIap9Yhth5gOEcLZ9F3bCAtyj-bLduw.png)

**Start Date: (image 10 of 14)**

This screenshot appears in the "Start Date:" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Select any date field. You can select a Specific Date, or Current Date, from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even from Inbound Webhook Trigger. Immediately after, the guide continues: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom….
- What to fill in: Select any date field. You can select a Specific Date, or Current Date, from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even from Inbound Webhook Trigger.
- Next: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.

### **Start Date Format:**

Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.

![Start Date Format: (image 11 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293485196/original/x1alZjEhaa3Bcvql1AKt9urx0eoKr9Iu1A.png)

**Start Date Format: (image 11 of 14)**

This screenshot appears in the "Start Date Format:" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to…. Immediately after, the guide continues: Select any date field. You can select a Specific Date or Current Date from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even an Inbound Webhook Trigger.
- What to fill in: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.
- Next: Select any date field. You can select a Specific Date or Current Date from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even an Inbound Webhook Trigger.

### **End Date:**

Select any date field. You can select a Specific Date or Current Date from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even an Inbound Webhook Trigger.

![End Date: (image 12 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293485191/original/c1isR7MZKKuBytIQEFfAeVzdZHE0ST9idw.png)

**End Date: (image 12 of 14)**

This screenshot appears in the "End Date:" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Select any date field. You can select a Specific Date or Current Date from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even an Inbound Webhook Trigger. Immediately after, the guide continues: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom….
- What to fill in: Select any date field. You can select a Specific Date or Current Date from Contact's date fields or date type custom fields, Appointment start/end date, Custom values, or even an Inbound Webhook Trigger.
- Next: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.

#### **End Date Format:**

Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.

![End Date Format: (image 13 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293485194/original/ms1zccoNhkzIk47RIxyB0Im3qaF2PHsP-w.png)

**End Date Format: (image 13 of 14)**

This screenshot appears in the "End Date Format:" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to…. Immediately after, the guide continues: After setting up the Compare Dates, you can use the results in further actions in your Workflow. {{datetime_formatter.1.days}}.
- What to fill in: Selecting system fields like Specific Date, Current Date, from Contact's date type standard fields, Contact's date type custom fields, or Appointment start or end date will auto-detect the format and preselect the same. If it is a Custom Value or from an Inbound Webhook trigger, you will have to select the exact matching format.
- Next: After setting up the Compare Dates, you can use the results in further actions in your Workflow. {{datetime_formatter.1.days}}

### **Output**

After setting up the Compare Dates, you can use the results in further actions in your Workflow. {{datetime\_formatter.1.days}}

The difference is calculated as End Date - Start Date, so you will get a negative value if the Start Date is greater than the End Date.

Custom Values

![Output (image 14 of 14)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/48293485195/original/TQD4-jxcpOu4EmXENgwAN5WSqddc-uaBag.png)

**Output (image 14 of 14)**

This screenshot appears in the "Output" section of "Workflow - Date/Time Formatter Action". The text alongside this image reads: The difference is calculated as End Date - Start Date, so you will get a negative value if the Start Date is greater than the End Date. Immediately after, the guide continues: Format the Inbound Webhook Trigger data to Set Event Start Date, to update Contact Custom Fields, to compare in If/Else Condition. Let's say the date format is MM/DD/YYYY, but you need to send it to an app that formats dates as….
- What this covers: The difference is calculated as End Date - Start Date, so you will get a negative value if the Start Date is greater than the End Date.
- Next: Format the Inbound Webhook Trigger data to Set Event Start Date, to update Contact Custom Fields, to compare in If/Else Condition. Let's say the date format is MM/DD/YYYY, but you need to send it to an app that formats dates as DD/MM/YYYY. You can use the Date/Time Formater to change the date format and send it via Custom Webhook. Store the custom formatted date time info in Google Sheets Use the custom formatted date time info in Email/SMS/Slack Compare the Current date(Start Date) with the Invoice Due date(End Date) and use the dynamic value in Email/SMS/Slack, Eg: Your Invoice is due in {{datetime_formatter.1.days}} days, Please Note:

---

## **Usage**

-   Format the Inbound Webhook Trigger data to Set Event Start Date, to update Contact Custom Fields, to compare in If/Else Condition.
-   Let's say the date format is MM/DD/YYYY, but you need to send it to an app that formats dates as DD/MM/YYYY. You can use the Date/Time Formater to change the date format and send it via Custom Webhook.
-   Store the custom formatted date time info in Google Sheets
-   Use the custom formatted date time info in Email/SMS/Slack
-   Compare the Current date(Start Date) with the Invoice Due date(End Date) and use the dynamic value in Email/SMS/Slack,  
    Eg: Your Invoice is due in {{datetime\_formatter.1.days}} days,  
    **Please Note:**

On overdue, that is when Current Date(Start Date) is greater than the Invoice Due Date(End Date) you will get the result in a negative value

---

Documentation for GHL Customer Care. Support: support@ghlcustomercare.com