Skip to main content

Workflow Action - Date/Time Formatter

Overview

The Date/Time Formatter action in Stack lets you format and compare date fields within your workflows. This feature is essential for transforming or evaluating dates to meet specific conditions or outputs.

Action Name

Date/Time Formatter

Action Description

1. Format Date

  • Description: This action allows you to convert a date field from one format to another within a workflow. For example, you can change a date from "MM/DD/YYYY" to "YYYY-MM-DD" to ensure consistency in reporting or communication.
  • Use Case: Perfect for situations where a uniform date format is required across different systems or reports.

2. Format Date and Time

  • Description: This action converts both date and time fields from one format to another, which is particularly useful for timestamps.
  • Use Case: Ideal for workflows involving appointments or timestamps where both date and time need to be reformatted.

3. Compare Dates

  • Description: This action compares two dates to determine which is earlier, later, or if they are equal. It can trigger actions based on whether one date falls within a specific time range of another.
  • Use Case: Useful for workflows that require comparing registration dates with event dates or any other time-sensitive comparisons.

Action Details

Format Date

  • Action Name: Assign a unique name to this action.
  • Action Type: Choose "Format Date."
  • Field: Select the date field you want to format.
  • From Format: Define the current format of the date.
  • To Format: Specify the desired format for the date.

Example Workflow:

  • Trigger: Form Submission
  • Action: Format the submission date to "YYYY-MM-DD" for consistent reporting.

Format Date and Time

  • Action Name: Assign a name to this action.
  • Action Type: Select "Format Date and Time."
  • Field: Choose the field containing the date and time.
  • From Format: Specify the current format (e.g., "DD/MM/YYYY HH:mm").
  • To Format: Define the desired format (e.g., "MM-DD-YYYY HH").

Example Workflow:

  • Trigger: Appointment Created
  • Action: Convert the appointment's Unix timestamp to a readable format for notifications.

Compare Dates

  • Action Name: Assign a name to this action.
  • Action Type: Select "Compare Dates."
  • Start Date: Choose the first date field for comparison.
  • Start Date Format: Define the format of the first date (e.g., "MM-DD-YYYY").
  • End Date: Select the second date field for comparison.
  • End Date Format: Specify the format of the second date (e.g., "DD/MM/YYYY").

Example Workflow:

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

Date and Time Format Supported

Here are some of the date and time formats supported by Stack:

  • YYYY-MM-DD: 2023-12-21
  • MM-DD-YYYY: 12-21-2023
  • MM/DD/YYYY: 12/21/2023
  • MM/DD/YY: 12/21/23
  • DD-MM-YYYY: 21-12-2023
  • DD/MM/YYYY: 21/12/2023
  • DD/MM/YY: 21/12/23
  • DD MMM YYYY: 21 Dec 2023
  • D MMMM YYYY: 21 December 2023
  • MMMM D, YYYY: December 21, 2023
  • MMM DD, YYYY: Dec 21, 2023
  • MMMM Do YYYY: December 21st, 2023
  • X (Unix Timestamp): 1703176259

Use these formats to ensure your date and time fields are consistent and meet the needs of your workflows in Stack.