Date and Time Handlers

Created by Reachware Support, Modified on Tue, 17 Mar at 12:19 PM by Reachware Support

Date and Time Handlers in Reachware Studio are predefined functions used to manipulate timestamps, adjust time units, format dates, and convert between different date representations during the mapping process.

Accessing Date and Time Handlers

1

Click on any destination field in the mapping panel

2

A pop-up window opens titled "DATE AND TIME HANDLER"

3

You'll see two sections:

  • Handlers — Available date functions
  • Variables — System variable (runtime)

Adding Time Units

addSeconds()

addSeconds(date; seconds)

Returns a new date by adding a given number of seconds. To subtract, enter a negative number.

Example

addSeconds(2016-12-08T15:55:57.536Z; 2) = 2016-12-08T15:55:59.536Z

addMinutes()

addMinutes(date; minutes)

Returns a new date by adding a given number of minutes. To subtract, enter a negative number.

Example

addMinutes(2016-12-08T15:55:57.536Z; 2) = 2016-12-08T15:57:57.536Z

addDays()

addDays(date; days)

Returns a new date by adding a given number of days. To subtract, enter a negative number.

Example

addDays(2016-12-08T15:55:57.536Z; 2) = 2016-12-10T15:55:57.536Z

addMonths()

addMonths(date; months)

Returns a new date by adding a given number of months. To subtract, enter a negative number.

Example

addMonths(2016-12-08T15:55:57.536Z; 2) = 2017-02-08T15:55:57.536Z

addYears()

addYears(date; years)

Returns a new date by adding a given number of years. To subtract, enter a negative number.

Example

addYears(2016-12-08T15:55:57.536Z; 2) = 2018-12-08T15:55:57.536Z

Setting Date Components

setSecond()

setSecond(date; second)

Returns a new date with the seconds set to the specified value. Accepts numbers from 0 to 59.

Example

setSecond(2015-10-07T11:36:39.138Z; 10) = 2015-10-07T11:36:10.138Z

setMinute()

setMinute(date; minute)

Returns a new date with the minute set to the specified value (0–59).

Example

setMinute(2015-10-07T11:36:39.138Z; 10) = 2015-10-07T11:10:39.138Z

setHour()

setHour(date; hour)

Returns a new date with the hour set to the specified value (0–23).

Example

setHour(2015-10-07T11:36:39.138Z; 10) = 2015-10-07T10:36:39.138Z

setDay()

setDate(date; day)

Returns a new date with the day set to the specified value (1–31).

Example

setDate(2015-08-07T11:36:39.138Z; 5) = 2015-08-05T11:36:39.138Z

setMonth()

setMonth(date; month)

Returns a new date with the month set to the specified value (1–12).

Example

setMonth(2015-08-07T11:36:39.138Z; 5) = 2015-05-07T11:36:39.138Z

setYear()

setYear(date; year)

Returns a new date with the year set to the specified value.

Example

setYear(2015-08-07T11:36:39.138Z; 2017) = 2017-08-07T11:36:39.138Z

Formatting and Parsing

formatDate()

formatDate(inputDate; outputFormat; inputFormat)

Converts a Date value into a human-readable text representation.

Example

formatDate("2025-01-07"; "MM/DD/YYYY"; "YYYY-MM-DD") = 01/07/2025

parseDate()

parseDate(textDate; format)

Converts a text value representing a date into a Date value.

Example

parseDate(2016-12-28; YYYY-MM-DD) = 2016-12-28T00:00:00.000Z

dateToTimestamp()

dateToTimestamp(date; unit)

Converts a given date to a Unix timestamp.

Example

dateToTimestamp("2025-01-07T10:00:00Z"; "milliseconds") = 1736253600000

convertUTCtoGMT()

convertUTCtoGMT(utcDate)

Converts a date in UTC format to GMT.

Example

convertUTCtoGMT("2025-01-07T10:00:00Z") = 2025-01-07T10:00:00.000 GMT

convertGMTtoUTC()

convertGMTtoUTC(gmtDate)

Converts a date in GMT format to UTC.

Example

convertGMTtoUTC("2025-01-07T10:00:00") = "2025-01-07T10:00:00.000Z"

toISOString()

toISOString(date)

Converts a date object into an ISO 8601 formatted string.

Example

toISOString("2025-01-07T10:00:00Z") = "2025-01-07T10:00:00.000Z"

Variables

{{runtime}}

{{runtime}}

Returns the exact time when the flow executes.


Related Topics

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article