Date Helper
Helper component for date and time manipulation.
Categories: Helpers
Type: dateHelper/v1
Actions
Add Time
Name: addTime
Add time to the date.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | Date to which time will be added. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| dateFormat | Date Format | STRING OptionsEEE MMM dd yyyy HH:mm:ss, EEE MMM dd HH:mm:ss yyyy, MMMM dd yyyy HH:mm:ss, MMMM dd yyyy, MMM dd yyyy, yyyy-MM-dd'T'HH:mm:ss, yyyy-MM-dd HH:mm:ss, yyyy-MM-dd, MM-dd-yyyy, MM/dd/yyyy, MM/dd/yy, dd-MM-yyyy, dd/MM/yyyy, dd.MM.yyyy, dd/MM/yy, dd.MM.yy, UnixTimestamp | Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits). | true |
| year | Year | INTEGER | Years to add. | false |
| month | Month | INTEGER | Months to add. | false |
| day | Day | INTEGER | Days to add. | false |
| hour | Hour | INTEGER | Hours to add. | false |
| minute | Minute | INTEGER | Minutes to add. | false |
| second | Second | INTEGER | Seconds to add. | false |
Example JSON Structure
{
"label" : "Add Time",
"name" : "addTime",
"parameters" : {
"date" : "2021-01-01T00:00:00",
"dateFormat" : "",
"year" : 1,
"month" : 1,
"day" : 1,
"hour" : 1,
"minute" : 1,
"second" : 1
},
"type" : "dateHelper/v1/addTime"
}Output
Type: STRING
Compare Dates
Name: compareDates
Compares two dates.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| dateA | Date A | DATE_TIME | First date that will be compared. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| dateB | Date B | DATE_TIME | Second date that will be compared. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| resolution | Resolution | STRING Optionsyear, month, day, hour, minute, second | The resolution at which the dates will be compared. Chosen resolution will be the smallest time unit that will be compared. | true |
| comparison | Comparison | STRING OptionsIS_AFTER, IS_AFTER_OR_EQUAL, IS_BEFORE, IS_BEFORE_OR_EQUAL, IS_EQUAL | The type of comparison to be performed. | true |
Example JSON Structure
{
"label" : "Compare Dates",
"name" : "compareDates",
"parameters" : {
"dateA" : "2021-01-01T00:00:00",
"dateB" : "2021-01-01T00:00:00",
"resolution" : "",
"comparison" : ""
},
"type" : "dateHelper/v1/compareDates"
}Output
Type: BOOLEAN
Compare Times
Name: compareTimes
Compare two time values, ignoring the dates/days.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| dateA | Date A | DATE_TIME | First date that will be compared. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| dateB | Date B | DATE_TIME | Second date that will be compared. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| comparison | Comparison | STRING OptionsIS_AFTER, IS_AFTER_OR_EQUAL, IS_BEFORE, IS_BEFORE_OR_EQUAL, IS_EQUAL | The type of comparison to be performed. | true |
Example JSON Structure
{
"label" : "Compare Times",
"name" : "compareTimes",
"parameters" : {
"dateA" : "2021-01-01T00:00:00",
"dateB" : "2021-01-01T00:00:00",
"comparison" : ""
},
"type" : "dateHelper/v1/compareTimes"
}Output
Type: BOOLEAN
Convert Date Timestamp
Name: convertUnixTimestampToIso8601
Converts UNIX timestamp to ISO8601 format.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| dateTimestamp | UNIX Timestamp | NUMBER | UNIX Timestamp in seconds (10 digits) or milliseconds (13 digits) | true |
| dateFormat | Date Format | STRING Optionsyyyy-MM-dd'T'HH:mm:ss.SSSZ, yyyy-MM-dd | Formatting that should be applied the text representation of date. | true |
Example JSON Structure
{
"label" : "Convert Date Timestamp",
"name" : "convertUnixTimestampToIso8601",
"parameters" : {
"dateTimestamp" : 0.0,
"dateFormat" : ""
},
"type" : "dateHelper/v1/convertUnixTimestampToIso8601"
}Output
Type: STRING
Date Difference
Name: dateDifference
Get the difference between two dates.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| startDate | Start Date | DATE_TIME | Start date of the interval. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| endDate | End Date | DATE_TIME | End date of the interval. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| unit | Unit | STRING Optionsyear, month, day, hour, minute, second | The unit of difference between the two dates. | true |
Example JSON Structure
{
"label" : "Date Difference",
"name" : "dateDifference",
"parameters" : {
"startDate" : "2021-01-01T00:00:00",
"endDate" : "2021-01-01T00:00:00",
"unit" : ""
},
"type" : "dateHelper/v1/dateDifference"
}Output
Type: NUMBER
Date Is in the Last
Name: dateIsInLast
Allows you to easily check if a given date has occurred in the last X number of seconds, minutes, hours, or days.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | Date for which you want to check is it in the last X number of selected time units. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| timeZone | Time Zone | STRING | Time zone to use when checking the date. | true |
| inLast | In Last | INTEGER | Number of how many time units. | true |
| unit | Unit | STRING Optionsyear, month, day, hour, minute, second | The unit of difference between the two dates. | true |
Example JSON Structure
{
"label" : "Date Is in the Last",
"name" : "dateIsInLast",
"parameters" : {
"date" : "2021-01-01T00:00:00",
"timeZone" : "",
"inLast" : 1,
"unit" : ""
},
"type" : "dateHelper/v1/dateIsInLast"
}Output
Type: BOOLEAN
Extract Date Units
Name: extractDateUnits
Extracts specific units (year, month, day, hour, minute, second, day of week, month name, date, or time) from a given date.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | The date from which to extract the specified unit. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| unit | Unit to Extract | STRING Optionsyear, month, day, hour, minute, second, dayOfWeek, monthName, date, time | Unit to extract from the input date. | true |
Example JSON Structure
{
"label" : "Extract Date Units",
"name" : "extractDateUnits",
"parameters" : {
"date" : "2021-01-01T00:00:00",
"unit" : ""
},
"type" : "dateHelper/v1/extractDateUnits"
}Output
The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.
Format Date
Name: formatDate
Format date to a desired format.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | Date which you want to format. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| dateFormat | Date Format | STRING OptionsEEE MMM dd yyyy HH:mm:ss, EEE MMM dd HH:mm:ss yyyy, MMMM dd yyyy HH:mm:ss, MMMM dd yyyy, MMM dd yyyy, yyyy-MM-dd'T'HH:mm:ss, yyyy-MM-dd HH:mm:ss, yyyy-MM-dd, MM-dd-yyyy, MM/dd/yyyy, MM/dd/yy, dd-MM-yyyy, dd/MM/yyyy, dd.MM.yyyy, dd/MM/yy, dd.MM.yy, UnixTimestamp | Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits). | true |
Example JSON Structure
{
"label" : "Format Date",
"name" : "formatDate",
"parameters" : {
"date" : "2021-01-01T00:00:00",
"dateFormat" : ""
},
"type" : "dateHelper/v1/formatDate"
}Output
Type: OBJECT
Get Current Date
Name: getCurrentDate
Get current date in the specified format.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| timeZone | Time Zone | STRING | Time zone to use when formatting date. | true |
| dateFormat | Date Format | STRING OptionsEEE MMM dd yyyy HH:mm:ss, EEE MMM dd HH:mm:ss yyyy, MMMM dd yyyy HH:mm:ss, MMMM dd yyyy, MMM dd yyyy, yyyy-MM-dd'T'HH:mm:ss, yyyy-MM-dd HH:mm:ss, yyyy-MM-dd, MM-dd-yyyy, MM/dd/yyyy, MM/dd/yy, dd-MM-yyyy, dd/MM/yyyy, dd.MM.yyyy, dd/MM/yy, dd.MM.yy, UnixTimestamp | Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits). | true |
Example JSON Structure
{
"label" : "Get Current Date",
"name" : "getCurrentDate",
"parameters" : {
"timeZone" : "",
"dateFormat" : ""
},
"type" : "dateHelper/v1/getCurrentDate"
}Output
Type: STRING
Get Days Between
Name: getDaysBetween
Get the number of days between two dates, rounded to the nearest day. If the second date is before the first date, the result will be negative.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| dateA | Start Date | DATE_TIME | Start date of the interval. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| dateB | End Date | DATE_TIME | End date of the interval. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
Example JSON Structure
{
"label" : "Get Days Between",
"name" : "getDaysBetween",
"parameters" : {
"dateA" : "2021-01-01T00:00:00",
"dateB" : "2021-01-01T00:00:00"
},
"type" : "dateHelper/v1/getDaysBetween"
}Output
Type: INTEGER
Get Duration
Name: getDuration
Given a total number of seconds, minutes, etc. – return human readable text containing how long the duration was approximately, in the units of your choosing.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| duration | Duration | INTEGER | The duration value. | true |
| unit | Unit | STRING Optionsyear, month, day, hour, minute, second | The unit of difference between the two dates. | true |
Example JSON Structure
{
"label" : "Get Duration",
"name" : "getDuration",
"parameters" : {
"duration" : 1,
"unit" : ""
},
"type" : "dateHelper/v1/getDuration"
}Output
Type: STRING
Get Time Between
Name: getTimeBetween
Get the time between two dates, as hh:mm:ss. If the second date is before the first date, the result will be negative.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| dateA | Start Date | DATE_TIME | Start date of the interval. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| dateB | End Date | DATE_TIME | End date of the interval. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
Example JSON Structure
{
"label" : "Get Time Between",
"name" : "getTimeBetween",
"parameters" : {
"dateA" : "2021-01-01T00:00:00",
"dateB" : "2021-01-01T00:00:00"
},
"type" : "dateHelper/v1/getTimeBetween"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| year | INTEGER | Number of years in between dates. |
| month | INTEGER | Number of months in between dates. |
| day | INTEGER | Number of days in between dates. |
| hour | INTEGER | Number of hours in between dates. |
| minute | INTEGER | Number of minutes in between dates. |
| second | INTEGER | Number of seconds in between dates. |
Output Example
{
"year" : 1,
"month" : 1,
"day" : 1,
"hour" : 1,
"minute" : 1,
"second" : 1
}Get Time From Now
Name: getTimeFromNow
Returns a human readable date relative to the current time, such as “in 2 months”, or “14 days ago”
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | Date to which time will be calculated. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
Example JSON Structure
{
"label" : "Get Time From Now",
"name" : "getTimeFromNow",
"parameters" : {
"date" : "2021-01-01T00:00:00"
},
"type" : "dateHelper/v1/getTimeFromNow"
}Output
Type: STRING
Is Between Dates?
Name: IsBetweenDates
Check to see whether a date falls within a date range.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | Date to check if it is in the range. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format. | true |
| dateA | Start Date | DATE_TIME | Start date of the interval. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| dateB | End Date | DATE_TIME | End date of the interval. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| resolution | Resolution | STRING Optionsyear, month, day, hour, minute, second | The resolution at which the dates will be compared. Chosen resolution will be the smallest time unit that will be compared. | true |
| inclusive | Inclusive | BOOLEAN Optionstrue, false | Whether the boundary is inclusive or not. | false |
Example JSON Structure
{
"label" : "Is Between Dates?",
"name" : "IsBetweenDates",
"parameters" : {
"date" : "2021-01-01T00:00:00",
"dateA" : "2021-01-01T00:00:00",
"dateB" : "2021-01-01T00:00:00",
"resolution" : "",
"inclusive" : false
},
"type" : "dateHelper/v1/IsBetweenDates"
}Output
Type: BOOLEAN
Is Between Times?
Name: IsBetweenTimes
Check to see whether a date falls within a time range.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | Date to check if it is in the range. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| timeA | Start Time | TIME | Start time of the interval. | true |
| timeB | End Time | TIME | End time of the interval. | true |
| inclusive | Inclusive | BOOLEAN Optionstrue, false | Whether the boundary is inclusive or not. | false |
| inclusiveSeconds | Inclusive Seconds | BOOLEAN Optionstrue, false | Whether the seconds will be compared. | false |
Example JSON Structure
{
"label" : "Is Between Times?",
"name" : "IsBetweenTimes",
"parameters" : {
"date" : "2021-01-01T00:00:00",
"timeA" : "00:00:00",
"timeB" : "00:00:00",
"inclusive" : false,
"inclusiveSeconds" : false
},
"type" : "dateHelper/v1/IsBetweenTimes"
}Output
Type: BOOLEAN
Is Business Hours?
Name: isBusinessHours
Check to see if it's business hours or not.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | Date to check to see if it is business hours. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| businessWeekStart | Business Week Start | INTEGER Options1, 2, 3, 4, 5, 6, 7 | First day of the business week. | true |
| businessWeekEnd | Business Week End | INTEGER Options1, 2, 3, 4, 5, 6, 7 | Last day of the business week. | true |
| businessHoursStart | Business Hours Start | TIME | Time of the day that business hours start. | true |
| businessHoursEnd | Business Hours End | TIME | Time of the day that business hours end. | true |
| timeZone | Time Zone | STRING | Time zone to check business hours for. | true |
Example JSON Structure
{
"label" : "Is Business Hours?",
"name" : "isBusinessHours",
"parameters" : {
"date" : "2021-01-01T00:00:00",
"businessWeekStart" : 1,
"businessWeekEnd" : 1,
"businessHoursStart" : "00:00:00",
"businessHoursEnd" : "00:00:00",
"timeZone" : ""
},
"type" : "dateHelper/v1/isBusinessHours"
}Output
Type: BOOLEAN
Is Weekend?
Name: isWeekend
Check if the current date is a weekend.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | Date to check to see if it is a weekend. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| timeZone | Time Zone | STRING | Time zone you are in. | true |
Example JSON Structure
{
"label" : "Is Weekend?",
"name" : "isWeekend",
"parameters" : {
"date" : "2021-01-01T00:00:00",
"timeZone" : ""
},
"type" : "dateHelper/v1/isWeekend"
}Output
Type: BOOLEAN
Subtract Time
Name: subtractTime
Subtract time from date
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| date | Date | DATE_TIME | Date from which time will be subtracted. We only accept yyyy-MM-ddTHH:mm:ss, use our Format Date action to transform the date format | true |
| dateFormat | Date Format | STRING OptionsEEE MMM dd yyyy HH:mm:ss, EEE MMM dd HH:mm:ss yyyy, MMMM dd yyyy HH:mm:ss, MMMM dd yyyy, MMM dd yyyy, yyyy-MM-dd'T'HH:mm:ss, yyyy-MM-dd HH:mm:ss, yyyy-MM-dd, MM-dd-yyyy, MM/dd/yyyy, MM/dd/yy, dd-MM-yyyy, dd/MM/yyyy, dd.MM.yyyy, dd/MM/yy, dd.MM.yy, UnixTimestamp | Here's what each part of the format (eg. YYYY) means: yyyy : Year (4 digits) yy : Year (2 digits) MMMM : Month (full name) MMM : Month (short name) MM : Month (2 digits) EEE : Day (short name) dd : Day (2 digits) HH : Hour (2 digits) mm : Minute (2 digits) ss : Second (2 digits). | true |
| year | Year | INTEGER | Years to subtract. | false |
| month | Month | INTEGER | Months to subtract. | false |
| day | Day | INTEGER | Days to subtract. | false |
| hour | Hour | INTEGER | Hours to subtract. | false |
| minute | Minute | INTEGER | Minutes to subtract. | false |
| second | Second | INTEGER | Seconds to subtract. | false |
Example JSON Structure
{
"label" : "Subtract Time",
"name" : "subtractTime",
"parameters" : {
"date" : "2021-01-01T00:00:00",
"dateFormat" : "",
"year" : 1,
"month" : 1,
"day" : 1,
"hour" : 1,
"minute" : 1,
"second" : 1
},
"type" : "dateHelper/v1/subtractTime"
}Output
Type: DATE_TIME
How is this guide?
Last updated on