Ask AI
Skip to main content

Create date

Function: Create Date

This function allows you to easily generate various types of date and time values without writing any code. You can create a date for the current moment, calculate specific dates like the first day of a month or year, adjust the current date by adding or subtracting time, or even define a completely static date. The resulting date will be stored in a variable that you name, ready for use in other parts of your application.

Input

  • Type: (Dropdown selection) Choose how you want to create your date. If you don't select an option, it will default to "Now".
    • Now: Creates a date and time representing the exact current moment.
    • First day of this year: Generates a date for January 1st of the current year.
    • First day of this month: Generates a date for the first day of the current month.
    • First day of a year: Creates a date for January 1st of a specific year you provide.
    • First day of a month: Creates a date for the first day of a specific month and year you provide.
    • Now minus something: Calculates a date by subtracting a specified amount of time from the current moment.
    • Now plus something: Calculates a date by adding a specified amount of time to the current moment.
    • Static date: Creates a date from a specific date text you enter.
  • Unit: (Dropdown selection) This option appears when 'Type' is set to 'Now minus something' or 'Now plus something'. Select the unit of time you want to add or subtract (e.g., Nanos, Seconds, Minutes, Hours, Days, Weeks, Months, Years).
  • Amount: (Number) This option appears when 'Type' is set to 'Now minus something' or 'Now plus something'. Enter the quantity of the chosen 'Unit' to add or subtract from the current date.
  • Year: (Number) This option appears when 'Type' is set to 'First day of a year' or 'First day of a month'. Provide the four-digit year (e.g., 2024) for which you want to create the date.
  • Month: (Number) This option appears when 'Type' is set to 'First day of a month'. Enter the number of the month (1 for January, 12 for December) for which you want to create the date.
  • Date (yyyy-MM-dd): (Text) This option appears when 'Type' is set to 'Static date'. Type the exact date you want to create in the 'YYYY-MM-DD' format (e.g., 2023-10-26).

Output

  • Generated Date: The new date and time value created by this action. You will provide a name for the variable where this date will be stored, and it will be available for use in subsequent actions.

Execution Flow

Real-Life Examples

Here are some practical ways you can use the "Create Date" function:

Example 1: Get the Current Date and Time

You want to record the exact moment an order was placed.

  • Inputs:
    • Output Variable Name: OrderTimestamp
    • Type: Now
  • Result: A variable named OrderTimestamp is created, holding the current date and time (e.g., 2023-10-26T14:35:00Z).

Example 2: Schedule a Follow-up for Next Week

You need to set a reminder for a task that should happen exactly 7 days from now.

  • Inputs:
    • Output Variable Name: FollowUpDate
    • Type: Now plus something
    • Unit: Days
    • Amount: 7
  • Result: A variable named FollowUpDate is created, holding the date and time exactly one week from the current moment (e.g., if today is 2023-10-26, FollowUpDate will be 2023-11-02T14:35:00Z).

Example 3: Find the Start of a Specific Project Month

You need to determine the first day of January 2024 to mark the beginning of a new project phase.

  • Inputs:
    • Output Variable Name: ProjectStart
    • Type: First day of a month
    • Year: 2024
    • Month: 1
  • Result: A variable named ProjectStart is created, holding the date 2024-01-01T00:00:00Z.