Create date
Function: Create date
This action allows you to easily generate various types of dates, from the current moment to specific dates in the past or future, or even fixed dates. It's a powerful tool for scheduling events, calculating deadlines, logging timestamps, or setting up date-based conditions in your applications without writing any code.
Input
-
Type
- A selection from a dropdown.
- This determines what kind of date you want to create.
- Options include:
- Now: The current date and time.
- First day of this year: The very first moment of the current year.
- First day of this month: The very first moment of the current month.
- First day of a year: The first moment of a specific year you choose.
- First day of a month: The first moment of a specific month and year you choose.
- Now minus something: A date and time in the past, relative to now.
- Now plus something: A date and time in the future, relative to now.
- Static date: A fixed date you provide.
-
Unit
- A selection from a dropdown.
- This specifies the unit of time (e.g., Days, Months, Years) you want to add or subtract from the current date.
- This input only appears if you select "Now minus something" or "Now plus something" for the "Type".
- Options include: Nanos, Seconds, Minutes, Hours, Days, Weeks, Months, Years.
-
Amount
- A number.
- This is the quantity of the chosen "Unit" to add or subtract from the current date.
- This input only appears if you select "Now minus something" or "Now plus something" for the "Type".
-
Year
- A number.
- The specific year you want to use when creating a date.
- This input only appears if you select "First day of this year" or "First day of this month" for the "Type".
-
Month
- A number.
- The specific month (1-12) you want to use when creating a date.
- This input only appears if you select "First day of this month" for the "Type".
-
Date (yyyy-MM-dd)
- A piece of text.
- The exact date you want to create, formatted as YYYY-MM-DD (e.g., 2023-10-27).
- This input only appears if you select "Static date" for the "Type".
Output
- Name
- A date.
- This is the variable where the newly created date will be stored. You can then use this variable in other actions.
Execution Flow
Real-Life Examples
Example 1: Get the Current Date and Time
You want to record the exact moment a user submits a form.
- Inputs:
- Type:
Now - Name (Output):
SubmissionTimestamp
- Type:
- Result: A new date variable named
SubmissionTimestampis created, holding the current date and time (e.g.,2023-10-27T10:30:00Z).
Example 2: Set a Deadline for Next Month
You need to automatically set a project deadline for the first day of the next month.
- Inputs:
- Type:
Now plus something - Unit:
Months - Amount:
1 - Name (Output):
NextMonthFirstDay
- Type:
- Result: A new date variable named
NextMonthFirstDayis created, representing the first day of the month following the current one (e.g., if today is October 27, 2023, the result would be2023-11-01T00:00:00Z).
Example 3: Find the Start of a Specific Fiscal Year
Your company's fiscal year starts on January 1st, and you need to find the start date for the 2022 fiscal year.
- Inputs:
- Type:
First day of a year - Year:
2022 - Name (Output):
FiscalYear2022Start
- Type:
- Result: A new date variable named
FiscalYear2022Startis created, holding the date2022-01-01T00:00:00Z.
Example 4: Schedule a Reminder for a Fixed Date
You want to send a reminder email on a specific, unmoving date, like a holiday.
- Inputs:
- Type:
Static date - Date (yyyy-MM-dd):
2024-12-25 - Name (Output):
Christmas2024
- Type:
- Result: A new date variable named
Christmas2024is created, holding the date2024-12-25T00:00:00Z.