Date Helper
The Date Helper piece in ZBrain Flow provides comprehensive date and time manipulation capabilities for your workflows. This versatile tool allows you to work with dates in various formats, calculate time differences, extract specific components of dates, and perform date arithmetic operations. Whether you need to schedule events, calculate durations, format timestamps, or determine specific days, the Date Helper offers a complete set of time-related functions without requiring custom code.
How to Use Date Helper in ZBrain Flow?
Step 1: Select Date Helper as Your Connection
Click on the '+' button in the Flow and search for Date Helper.
Select Date Helper.
Decide on the action you need. ZBrain Flow provides several options:
Get Current Date – Retrieves the current date and time.
Format Date – Converts a date from one format to another.
Extract Date Units – Extracts components like year, month, day from a date.
Date Difference – Calculates the time between two dates.
Add/Subtract Time – Performs date arithmetic operations.
Next Day of Week – Finds the next occurrence of a specific weekday.
Next Day of Year – Finds the next occurrence of a specific calendar day.
How to Get Current Date?
Step 1: Add Get Current Date Action
Choose the ‘Get Current Date’ action from the list of options available.
Step 2: Configure Output Format
In the ‘To Time Format’ field, select how you want the date and time to be formatted (e.g., DDD MMM DD YYYY HH:mm:ss → Sun Sep 17 2023 11:23:58).
Step 3: Select Time Zone
Choose your desired time zone from the ‘Time Zone’ dropdown.
How to Format Date?
Step 1: Add Format Date Action
Choose the ‘Format Date’ action from the options available. This action allows you to convert dates from one format to another and switch between time zones.
Step 2: Configure Input Date
In the ‘Input Date’ field, enter the date you want to format.
Select the ‘From Time Format’ to match your input date's current format (e.g., DDD MMM DD YYYY HH:mm:ss → Sun Sep 17 2023 11:23:58).
Step 3: Select Input Time Zone
Choose the ‘From Time Zone’ that your input date is currently in.
Step 4: Set Output Time Format and Zone
Choose your desired ‘To Time Format’ for how you want the date to appear after conversion. You can select from preset formats.
Choose the ‘To Time Zone’ for the destination time zone. This allows you to convert the date across different time zones as needed.
How to Extract Date Units?
Step 1: Add Extract Date Units Action
Choose the ‘Extract Date Units’ action from the Date Helper.
Step 2: Configure Input Date and Format
In the ‘Input Date’ field, enter the date you want to extract information from.
Set the ‘From Time Format’ to match your input date's format (e.g., DDD MMM DD YYYY HH:mm:ss → Sun Sep 17 2023 11:23:58).
Step 3: Select Unit to Extract
From the ‘Unit to Extract’ dropdown, choose the component you want to extract (e.g., year, month, day, minute, hour).
How to Calculate Date Differences?
Step 1: Add Date Difference Action
Choose the ‘Date Difference’ action from Date Helper.
Step 2: Configure Starting Date and Format
In the ‘Starting Date’ field, enter the earlier date.
Set the ‘Starting date format’ to match your input date's format (e.g., DDD MMM DD YYYY HH:mm:ss → Sun Sep 17 2023 11:23:58).
Step 3: Configure Ending Date and Format
In the ‘Ending Date’ field, enter the later date to compare against.
Set the ‘Ending date’ format to match your second date's format.
Step 4: Select Measurement Unit
From the ‘Unit’ dropdown, choose how you want to measure the difference (e.g., year, month, day, minute, hour).
How to Add/Substract Time?
Step 1: Add the Add/Subtract Time Action
Choose the ‘Add/Subtract Time’ action from the available ‘Date Helper’ options.
Step 2: Configure and Specify Input Date and Format
In the ‘Input Date’ field, enter the base date you want to modify.
Choose from the dropdown options available in the ‘From Time Format’ that best represents your input date's format.
Step 3: Set Output Format
Select from various format options available in the ‘To Time Format’ for how you want the resulting date to appear.
Step 4: Enter Time Expression
In the ‘Expression’ field, specify how much time to add or subtract
Use the following syntax:
To add time:
+ [number] [unit]
(e.g.,+ 2 hour
)To subtract time:
- [number] [unit]
(e.g.,- 3 day
)Valid units: year, month, day, hour, minute, second
How to Find the Next Day of Week?
Step 1: Add Next Day of Week Action
Choose the ‘Next Day of Week’ action from the available options in ‘Date Helper’.
Step 2: Select Target Weekday
From the ‘Weekday’ dropdown, choose which day of the week you want to get the date and time of (Monday, Tuesday, etc.).
Step 3: Specify Time
Enter the desired time in the ‘24h Time’ field using 24-hour format (e.g., 14:30 for 2:30 PM).
Alternatively, enable ‘Use Current Time’ to automatically use the current time instead.
Step 4: Configure Output Format
Set the ‘To Time Format’ for how you want the resulting date and time to appear.
Step 5: Select Time Zone
Choose the ‘Time Zone’ for the result from the dropdown.
How to Find the Next Day of Year?
Step 1: Add Next Day of Year Action
Choose the ‘Next Day of Year’ action from the available options in Date Helper.
Step 2: Select Month
From the ‘Month’ dropdown, choose which month you want to target (January, February, etc.).
Step 3: Specify Day of Month
Enter the desired ‘Day of Month’ (1-31, depending on the month).
Step 4: Set Time
Enter the desired time in the ‘24h Time’ field (e.g., 14:30 for 2:30 PM).
Or enable ‘Use Current Time’ to automatically use the current time instead.
Step 5: Configure Output Format
Set the ‘To Time Format’ for how you want the resulting date and time to appear.
Step 6: Select Time Zone
Choose the ‘Time Zone’ for the result from the dropdown.
Last updated