Ask AI
Skip to main content

Create date

Function: Create date

This function allows you to easily generate various date and time values, from the current moment to specific dates in the past or future, or even the first day of a particular month or year. You can use it to set deadlines, track events, or perform calculations based on dates without writing any code.

Input,

  • Type (Selection from a dropdown): This is the main choice that determines how your date will be created.
    • Now: Creates a date and time representing the exact moment the action runs.
    • First day of this year: Creates a date representing the very first moment (midnight) of the current year.
    • First day of this month: Creates a date representing the very first moment (midnight) of the current month.
    • First day of a year: Creates a date representing the very first moment (midnight) of a specific year you provide.
    • First day of a month: Creates a date representing the very first moment (midnight) of a specific month and year you provide.
    • Now minus something: Creates a date and time in the past by subtracting a specified amount of time from the current moment.
    • Now plus something: Creates a date and time in the future by adding a specified amount of time to the current moment.
    • Static date: Creates a date based on a specific date string you provide.
    • Default value: Now
  • Unit (Selection from a dropdown): This input appears only if you choose "Now minus something" or "Now plus something" for the Type. It specifies the unit of time you want to add or subtract (e.g., Nanos, Seconds, Minutes, Hours, Days, Weeks, Months, Years).
  • Amount (Number): This input appears only if you choose "Now minus something" or "Now plus something" for the Type. It specifies how many Units you want to add or subtract.
  • Year (Number): This input appears only if you choose "First day of a year" or "First day of a month" for the Type. It specifies the target year for your date.
  • Month (Number): This input appears only if you choose "First day of a month" for the Type. It specifies the target month (1-12) for your date.
  • Date (yyyy-MM-dd) (Text): This input appears only if you choose "Static date" for the Type. You should enter the date in the format YYYY-MM-DD (e.g., 2023-10-26).

Output,

  • Name (Date): This is the name of the variable where the newly created date and time value will be stored. You can then use this variable in other actions.
    • Default value: TODAY

Execution Flow,

Real-Life Examples,

  1. Example: Capture the exact moment an order was placed

    • Inputs:
      • Type: Now
      • Name: OrderTimestamp
    • Result: A variable named OrderTimestamp will hold the precise date and time (e.g., 2023-10-26 14:35:01) when the action was executed, marking the order placement.
  2. Example: Calculate a project deadline 30 days from now

    • Inputs:
      • Type: Now plus something
      • Unit: Days
      • Amount: 30
      • Name: ProjectDeadline
    • Result: A variable named ProjectDeadline will store the date and time exactly 30 days in the future from when the action runs (e.g., 2023-11-25 14:35:01).
  3. Example: Find the start of the current fiscal year

    • Inputs:
      • Type: First day of this year
      • Name: FiscalYearStart
    • Result: A variable named FiscalYearStart will contain the date 2023-01-01 00:00:00, representing the beginning of the current year.
  4. Example: Schedule a recurring report for the first day of a specific month

    • Inputs:
      • Type: First day of a month
      • Year: 2024
      • Month: 7
      • Name: July2024ReportDate
    • Result: A variable named July2024ReportDate will hold the date 2024-07-01 00:00:00, which can be used to trigger a report.
  5. Example: Set a fixed event date

    • Inputs:
      • Type: Static date
      • Date \(yyyy-MM-dd\): 2024-01-15
      • Name: EventDate
    • Result: A variable named EventDate will store the specific date 2024-01-15 00:00:00, regardless of when the action is executed.