# Workflow Action - Dare/Time Formatter

> TABLE OF CONTENTS Overview Action Name Action Description Action Details Example Overview The Date/Time Formatter action allows you to format and compare…

- Source: https://docs.ghlcustomercare.com/docs/workflows/workflow-actions/workflow-action-dare-time-formatter
- Section: Workflows / Workflow Actions
- Reading time: 2 min
- Images: 3, each explained below
- Modified on Sat, 7 Sep, 2024 at 5:59 AM

---
**TABLE OF CONTENTS**

-   [Overview](#overview)
-   [Action Name](#action-name)
-   [Action Description](#action-description)
-   [Action Details](#action-details)
-   [Example](#Example)

## Overview

The **Date/Time Formatter** action allows you to format and compare date fields within workflows. This action helps transform or evaluate dates to better suit specific conditions or outputs.

## Action Name

**Date/Time Formatter**

## Action Description

### 1\. Format Date

-   **Description**: This action converts a date field from one format to another within a workflow. For example, you can convert a date from "MM/DD/YYYY" to "YYYY-MM-DD" to standardize dates for consistent reporting or communication.
    
-   **Use Case**: Useful when you need to ensure a uniform date format across various systems or reports.
    

### 2\. Format Date and Time

-   **Description**: This action converts both date and time fields from one format to another. This action is especially useful for timestamps that include both date and time components.
    
-   **Use Case**: Great for workflows that deal with appointments or timestamps, where both date and time need to be reformatted.
    

### 3\. Compare Dates

-   **Description**: This action compares two dates and evaluates which date is earlier, later, or whether the dates are equal. This can be used to trigger actions based on whether one date is within a specific time range of another date.
    
-   **Use Case**: Ideal for workflows where you want to compare registration dates with event dates or any other form of time-sensitive comparison.
    

## Action Details

### **Format Date**

![Format Date (image 1 of 3)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155032443696/original/EB9x6SiLjUy0ebJ5-CPftaRAP5VX_ypYEA.png)

**Format Date (image 1 of 3)**

This screenshot appears in the "Format Date" section of "Workflow Action - Dare/Time Formatter". The text alongside this image reads: Description: This action compares two dates and evaluates which date is earlier, later, or whether the dates are equal. This can be used to trigger actions based on whether one date is within a specific time range of another date. Use Case: Ideal for workflows where you want to compare…. Immediately after, the guide continues: Field Name Description Mandatory Action Name The unique name you want to assign to this action. Yes Action Type Choose the type of formatting action (Format Date, Compare Dates). Yes Field Select the date field you want to format or….
- What this covers: Description: This action compares two dates and evaluates which date is earlier, later, or whether the dates are equal. This can be used to trigger actions based on whether one date is within a specific time range of another date. Use Case: Ideal for workflows where you want to compare registration dates with event dates or any other form of time-sensitive comparison.
- Next: Field Name Description Mandatory Action Name The unique name you want to assign to this action. Yes Action Type Choose the type of formatting action (Format Date, Compare Dates). Yes Field Select the date field you want to format or compare. Yes From Format Define the existing format of the date field. Yes To Format Define the desired format for the date field. Yes

### Action Details

<table border="1" cellpadding="0" cellspacing="0" dir="ltr" style="width: 0px"><colgroup><col width="100"><col width="506"><col width="119"></colgroup><tbody><tr><td dir="ltr" style="vertical-align: bottom; text-align: center">Field Name</td><td style="vertical-align: bottom; font-weight: normal; text-align: center">Description</td><td style="vertical-align: bottom; font-weight: normal; text-align: center">Mandatory</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Action Name</td><td style="vertical-align: bottom; white-space: normal">The unique name you want to assign to this action.</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Action Type</td><td style="vertical-align: bottom; white-space: normal">Choose the type of formatting action (Format Date, Compare Dates).</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Field</td><td style="vertical-align: bottom; white-space: normal">Select the date field you want to format or compare.</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">From Format</td><td style="vertical-align: bottom; white-space: normal">Define the existing format of the date field.</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">To Format</td><td style="vertical-align: bottom; white-space: normal">Define the desired format for the date field.</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr></tbody></table>

### Example Workflow:

-   ### **Trigger**: Form Submission
    
-   **Action**: Format the date of submission to YYYY-MM-DD format for further usage in reporting.

\----------------------------------------------------------------------------------------------------------------------

### **Format Date and Time**

### **

![Format Date and Time (image 2 of 3)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155032443743/original/am1uX2LJ2wO4kfQ5sfTOEDOE-nFqnmsApg.png)

**Format Date and Time (image 2 of 3)**

This screenshot appears in the "Format Date and Time" section of "Workflow Action - Dare/Time Formatter". The text alongside this image reads: ----------------------------------------------------------------------------------------------------------------------. Immediately after, the guide continues: Field Description Mandatory Action Name The name you assign to this specific action. Yes Action Type Selected as “Format Date and Time.” Yes Field The field containing the date and time to be formatted. Yes From Format The current format….
- What this covers: ----------------------------------------------------------------------------------------------------------------------
- Next: Field Description Mandatory Action Name The name you assign to this specific action. Yes Action Type Selected as “Format Date and Time.” Yes Field The field containing the date and time to be formatted. Yes From Format The current format of the date and time (e.g., DD/MM/YYYY HH:mm). Yes To Format The desired format for both date and time (e.g., MM-DD-YYYY HH). Yes

**

### Action Details

<table border="1" cellpadding="0" cellspacing="0" dir="ltr" style="width: 0px"><colgroup><col width="100"><col width="506"><col width="119"></colgroup><tbody><tr><td style="vertical-align: bottom; text-align: center">Field</td><td style="vertical-align: bottom; font-weight: normal; text-align: center">Description</td><td style="vertical-align: bottom; font-weight: normal; text-align: center">Mandatory</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Action Name</td><td style="vertical-align: bottom; white-space: normal">The name you assign to this specific action.</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Action Type</td><td style="vertical-align: bottom; white-space: normal">Selected as “Format Date and Time.”</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Field</td><td style="vertical-align: bottom; white-space: normal">The field containing the date and time to be formatted.</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">From Format</td><td style="vertical-align: bottom; white-space: normal">The current format of the date and time (e.g., DD/MM/YYYY HH:mm).</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">To Format</td><td style="vertical-align: bottom; white-space: normal">The desired format for both date and time (e.g., MM-DD-YYYY HH).</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr></tbody></table>

### Example Workflow:

-   ### **Trigger**: Appointment Created
    
-   **Action**: Format the appointment date and time from Unix timestamp to readable format for notifications.

\----------------------------------------------------------------------------------------------------------------------

### **Compare Dates**

![Compare Dates (image 3 of 3)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155032443775/original/KT6ZVL-Tn7GpI94F2E6NzyP0_YFrkDyjdw.png)

**Compare Dates (image 3 of 3)**

This screenshot appears in the "Compare Dates" section of "Workflow Action - Dare/Time Formatter". The text alongside this image reads: ----------------------------------------------------------------------------------------------------------------------. Immediately after, the guide continues: Field Description Mandatory Action Name The name you assign to this specific action. Yes Action Type Selected as “Compare Dates.” Yes Start Date The first date field you want to compare. Yes Start Date Format The format of the first date….
- What this covers: ----------------------------------------------------------------------------------------------------------------------
- Next: Field Description Mandatory Action Name The name you assign to this specific action. Yes Action Type Selected as “Compare Dates.” Yes Start Date The first date field you want to compare. Yes Start Date Format The format of the first date (e.g., MM-DD-YYYY). Yes End Date The second date field to compare. Yes End Date Format The format of the second date (e.g., DD/MM/YYYY). Yes

### Action Details

<table border="1" cellpadding="0" cellspacing="0" dir="ltr" style="width: 0px"><colgroup><col width="100"><col width="506"><col width="119"></colgroup><tbody><tr><td style="vertical-align: bottom; text-align: center">Field</td><td style="vertical-align: bottom; font-weight: normal; text-align: center">Description</td><td style="vertical-align: bottom; font-weight: normal; text-align: center">Mandatory</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Action Name</td><td style="vertical-align: bottom; white-space: normal">The name you assign to this specific action.</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Action Type</td><td style="vertical-align: bottom; white-space: normal">Selected as “Compare Dates.”</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Start Date</td><td style="vertical-align: bottom; white-space: normal">The first date field you want to compare.</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">Start Date Format</td><td style="vertical-align: bottom; white-space: normal">The format of the first date (e.g., MM-DD-YYYY).</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">End Date</td><td style="vertical-align: bottom; white-space: normal">The second date field to compare.</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr><tr><td style="vertical-align: bottom; white-space: normal">End Date Format</td><td style="vertical-align: bottom; white-space: normal">The format of the second date (e.g., DD/MM/YYYY).</td><td style="vertical-align: bottom; font-weight: normal; white-space: normal">Yes</td></tr></tbody></table>

### Example Workflow:

-   ### **Trigger**: Event Registration
    
-   **Action**: Compare registration date with the event date to send reminders if the event is within 3 days.

## Date and Time Format Supported

<table border="1" cellpadding="0" cellspacing="0" dir="ltr" style="width: 0px"><colgroup><col width="146"><col width="230"></colgroup><tbody><tr><td style="vertical-align: bottom; text-align: center">Format Type</td><td style="vertical-align: bottom; font-weight: normal; text-align: center">Example Output</td></tr><tr><td style="vertical-align: bottom; white-space: normal">YYYY-MM-DD</td><td style="vertical-align: bottom; white-space: normal">45281</td></tr><tr><td style="vertical-align: bottom; white-space: normal">MM-DD-YYYY</td><td style="vertical-align: bottom; white-space: normal">45281</td></tr><tr><td style="vertical-align: bottom; white-space: normal">MM/DD/YYYY</td><td style="vertical-align: bottom; white-space: normal">45281</td></tr><tr><td style="vertical-align: bottom; white-space: normal">MM/DD/YY</td><td style="vertical-align: bottom; white-space: normal">45281</td></tr><tr><td style="vertical-align: bottom; white-space: normal">DD-MM-YYYY</td><td style="vertical-align: bottom; white-space: normal">21-12-2023</td></tr><tr><td style="vertical-align: bottom; white-space: normal">DD/MM/YYYY</td><td style="vertical-align: bottom; white-space: normal">21/12/2023</td></tr><tr><td style="vertical-align: bottom; white-space: normal">DD/MM/YY</td><td style="vertical-align: bottom; white-space: normal">21/12/23</td></tr><tr><td style="vertical-align: bottom; white-space: normal">DD MMM YYYY</td><td style="vertical-align: bottom; white-space: normal">45281</td></tr><tr><td style="vertical-align: bottom; white-space: normal">D MMMM YYYY</td><td style="vertical-align: bottom; white-space: normal">45281</td></tr><tr><td style="vertical-align: bottom; white-space: normal">MMMM D, YYYY</td><td style="vertical-align: bottom; white-space: normal">45281</td></tr><tr><td style="vertical-align: bottom; white-space: normal">MMM DD, YYYY</td><td style="vertical-align: bottom; white-space: normal">45281</td></tr><tr><td style="vertical-align: bottom; white-space: normal">MMMM Do YYYY</td><td style="vertical-align: bottom; white-space: normal">December 21st, 2023</td></tr><tr><td style="vertical-align: bottom; white-space: normal">X (Unix Timestamp)</td><td style="vertical-align: bottom; white-space: normal">1703176259</td></tr></tbody></table>

---

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