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 manyUnitsyou 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,
-
Example: Capture the exact moment an order was placed
- Inputs:
Type:NowName:OrderTimestamp
- Result: A variable named
OrderTimestampwill hold the precise date and time (e.g.,2023-10-26 14:35:01) when the action was executed, marking the order placement.
- Inputs:
-
Example: Calculate a project deadline 30 days from now
- Inputs:
Type:Now plus somethingUnit:DaysAmount:30Name:ProjectDeadline
- Result: A variable named
ProjectDeadlinewill store the date and time exactly 30 days in the future from when the action runs (e.g.,2023-11-25 14:35:01).
- Inputs:
-
Example: Find the start of the current fiscal year
- Inputs:
Type:First day of this yearName:FiscalYearStart
- Result: A variable named
FiscalYearStartwill contain the date2023-01-01 00:00:00, representing the beginning of the current year.
- Inputs:
-
Example: Schedule a recurring report for the first day of a specific month
- Inputs:
Type:First day of a monthYear:2024Month:7Name:July2024ReportDate
- Result: A variable named
July2024ReportDatewill hold the date2024-07-01 00:00:00, which can be used to trigger a report.
- Inputs:
-
Example: Set a fixed event date
- Inputs:
Type:Static dateDate \(yyyy-MM-dd\):2024-01-15Name:EventDate
- Result: A variable named
EventDatewill store the specific date2024-01-15 00:00:00, regardless of when the action is executed.
- Inputs: