Jump to a Section
  • Add

    Adds a multiple of a unit of time (e.g. seconds) from a starting date & time, returning the resulting date.

    Input Fields

    All three inputs are required:

    • start date: the start date & time.
    • add: (a number) how much to add to the start date & time.
    • units: choose from the list the units (in scale) that you’d like to add.

    Output Fields

    • output: the date & time that comes after the start date & time as specified

    Examples If _start date_ is 5-Sept-2016, add is 2 and units is weeks, then output will be 19-Sept-2016. If _start date_ is 19-Sept-2016 9:00am, add is 8 and units is hours, then output will be 19-Sept-2016 5:00pm.

    If you want to start with the current date and time, use a Now card and drag/drop the date field from the Now card into the start date field on the Add card.

    Date & Time results are displayed and converted to text in ISO date format using UTC “Z” notation (i.e. not adjusted for local time zone). If you need to display a date and time in a specific time zone, use Date to Text.

  • Convert

    Converts a date & time to a variety of formats.

    Input Fields

    • start: (required) a date & time text in ISO format or a date & time object will automatically convert, as will many common date & time text formats.
    • format - (optional) a date format code that indicates how to display the date and/or time, such as “M/D/Y” to get a result like “9/7/2016” or “hh:mm a” for a time like “09:05 am” (see Date to Text for information on using format codes)
    • zone - (optional) a “TZ” time zone such as “US/Pacific” or “Europe/Paris” (see full list on wikipedia).

    Output Fields

    • date - the date & time object the corresponds to the start text. (Note: This is often unnecessary as date & time input fields will automatically convert date & time text.)
    • iso - the full date and time in ISO date format but without fractional seconds, using UTC “Z” notation (e.g. “2016-09-07T16:55:25Z”)
    • epoch - as standard in many systems, this converts the start date & time to the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds.
    • unix - similar to epoch, but the total number of milliseconds since January 1, 1970.
    • human - a human readable date & time, but not adjusted for local time zone.
    • custom - the text of the date in the format specified by the format and _zone_ input fields.

    Note: The input fields format and zone work only with the output field custom. See the Date to Text function for details and examples of how to generate custom formatted dates and times as text. (Using the _custom_ output field is equivalent to using the Date To Text function.)

    Example

    If the _start_ is “2016-09-07T00:01:25.670Z” then:

    • _date_ is 2016-09-07T00:01:25.670Z
    • _iso_ is “2016-09-07T00:01:25Z”
    • _epoch_ is 1473206485
    • _unix_ is 1473206485670
    • human is “Wed, September 7th at 12:01 AM”

    See the Date to Text function for examples for the custom output field. (The _custom_ output in combination with the format and zone inputs works the same as Date To Text.)

  • Date to Text

    Formats a date and time into a provided format in a specified timezone.

    Input Fields

    • start - the date and time you wish to format
    • format - a date format code that indicates how to display the date and/or time, such as “M/D/Y” to get a result like “9/7/2016” or “hh:mm a” for a time like “09:05 am” (see table below for list of acceptable format codes)
    • zone - a “TZ” time zone such as “US/Pacific” or “Europe/Paris” (see full list on wikipedia).

    Output Fields

    • output - the text of the date in the chosen format in the designated timezone

    Format Codes

    Build the format for the date and/or time format you want using any combination of the following codes along with fixed characters like slashes and commas:

    • D for day number (in the month) or DD to always show it using two digits
    • M for month number or MM for always two digits
    • MMM for three letter month name abbreviation or MMMM for full month name
    • Y for four digit year number or YY for two-digit year number
    • h for hour number (1-12) or hh to always show it using two digits
    • H for hour number (0-23) or HH to always show it using two digits
    • mm for minutes
    • ss for seconds (and add S’s to include milliseconds, e.g. “ss.SSS”)
    • a for “am” or “pm” or A for “AM” or “PM”
    • Z for timezone in offset format (e.g. “-07:00”) or z for code (e.g. “PDT”)
    • d for day of the week (1=Monday), ddd for day abbreviation (e.g. “Mon”) or dddd for full day name (e.g. “Monday”)

    Examples If the ISO date is 2016-09-07T00:01:25.670Z and zone is “US/Pacific” then:

    • format “M/D/Y” results in output “9/6/2016”
    • format “h:mm a z” results in output “9:01 am PDT”
    • format “dddd, MMMM D, Y” results in output “Wednesday, September 7, 2016”
    • format “D-MMM-YY HH:mm:ss.S z” results in output “7-Sep-16 09:01:25.6 PDT”

    If you want to format the current date and time, use a Now card and drag/drop the date field from the Now card into the start field on the Date To Text card.

  • Difference

    Returns the difference in time between two dates.

    Input Fields

    • end date (Date & Time): the base time you want to compare, i.e. if you want to say how many days until a date, this is that date.
    • start date (Date & Time): the time you want to compare to. If start is a later date & time than end, then the output values will all be negative (i.e. reflecting that it is past the date).

    Output Fields

    All of the outputs express the full amount of time it will take to get to end from start in that unit. For instance if end is exactly one day after start, then days will be 1 and hours will be 24.

    • days (Number): the number of days to get to end from start, including fractional days.
    • months (Number): the total difference in months
    • years (Number): the total difference in years
    • hours (Number): the total difference in hours
    • minutes (Number): the difference in minutes
    • seconds (Number): the difference in seconds
    • milliseconds (Number): the difference in milliseconds
  • Epoch

    Converts a date & time to the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT) not counting leap seconds, which is the standard date format for some systems. (See UNIX to use the number of milliseconds elapsed instead of seconds.)

    Input Fields

    • start: (required) the date & time you want to convert.

    Output Fields

    • output: the date & time in epoch format: seconds since January 1, 1970, midnight UTC/GMT, not counting leap seconds.

    Example If _start_ is 2016-09-07T00:01:25.670Z then output is 1473206485 If you need the Epoch format for the current date and time, use a Now card and drag/drop the date field from the Now card into the start field on the Epoch card.

  • ISO

    Given a date & time, returns the corresponding iso8601 string using UTC “Z” notation, i.e. not adjusted for local time zone (e.g. “2016-09-07T16:55:25.670Z”)

    Input Fields

    • start: the date & time you want to convert

    Output Fields

    • output: the output field

    Notes:

    This function is often unnecessary. When you drag a date & time object into any text input field, it will automatically convert to the ISO UTC “Z” notation format. If you want to get the current date and time, use a Now card. If you need to display a date and time in a specific time zone, use Date to Text.

  • Now

    Returns the current date and time in a variety of formats, all in UTC time (i.e. not adjusted for local timezone). Use the Date to Text function to adjust a date to a timezone.

    Output Fields

    • date - the full date and time in ISO date format using UTC “Z” notation (e.g. “2016-09-07T16:55:25.670Z”)
    • iso - the full date and time in ISO format using offset notation (e.g. “2016-09-07T16:55:25+00:00”)
    • full - the expanded date and time in UTC format (e.g. “September 7, 2016 16:55:25.670”)
    • minute - the current minute as a number
    • hour - the current hour as a number, in 24 hour time, UTC time
    • time - the current time as a string, in 24 hour time, UTC time
    • day - the current day as a number, in UTC time
    • month - the current month number, in UTC time
    • year - the current year as a number, in UTC time
    • second - the current second as a number
    • millisecond - the current millisecond

    Example:

    When it’s 9:55 AM (and 25.670 seconds) in Los Angeles on September 9, 2016, the Now card outputs will have the following values:

    • date - 2016-09-07T16:55:25.670Z
    • iso - 2016-09-07T16:55:25+00:00
    • full - September 7, 2016 16:55:25.670
    • minute - 55
    • hour - 16
    • time - 16:55:25.670
    • day - 9
    • month - 7
    • year - 2016
    • second - 25
    • millisecond - 670
  • Subtract

    Subtracts a multiple of a unit of time (e.g. seconds) from a starting date & time, returning the resulting date.

    Input Fields

    All three inputs are required:

    • start date: the start date & time.
    • subtract: (a number) how much to subtract from the start date & time.
    • units: choose from the list the units that you’d like to subtract

    Output Fields

    • output: the date & time that comes before the start date & time as specified by the scale and unit

    Examples

    If _start date_ is 19-Sept-2016, subtract is 2 and units is weeks, then output will be 5-Sept-2016. If _start date_ is 19-Sept-2016 5:00pm, subtract is 8 and units is hours, then output will be 19-Sept-2016 9:00am.

    If you want to start with the current date and time, use a Now card and drag/drop the date field from the Now card into the start field on the Subtract card.

    Date & Time results are displayed and converted to text in ISO date format using UTC “Z” notation (i.e. not adjusted for local time zone). If you need to display a date and time in a specific time zone, use Date to Text.

  • Text to Date

    Creates a date & time from the contents of text, according to a format you specify. The specified format identifies the format of the ‘start’ input contents.

    NOTE: For most standard formats, this function is not necessary. You can just pass any standard date & time text into a date input and it will convert automatically. This function is for non-standard or ambiguous formats (e.g. depending on the country of origin 2/1 might be 1-Feb or 2-Jan).

    Input Fields

    • start – the text you want to convert to a date and time
    • format – a date format code that indicates the format of the start date input

    Output Fields

    • output – the date object that corresponds to the provided text and format

    Format Codes

    Identify the format for the input date and/or time format you want using any combination of the following codes along with fixed characters like slashes and commas:

    • D for day number (in the month) or DD to always show it using two digits
    • M for month number or MM for always two digits
    • MMM for three letter month name abbreviation or MMMM for full month name
    • Y for four digit year number or YY for two-digit year number
    • h for hour number (1-12) or hh to always show it using two digits
    • H for hour number (0-23) or HH to always show it using two digits
    • mm for minutes
    • ss for seconds (and add S‘s to include milliseconds, e.g. “ss.SSS”)
    • a for “am” or “pm” or A for “AM” or “PM”
    • Z for timezone in offset format (e.g. “-07:00”)
    • d for day of the week (1=Monday), ddd for day abbreviation (e.g. “Mon”) or dddd for full day name (e.g. “Monday”)
    • x for a timestamp in “unix in milliseconds” format, defined as the count of milliseconds since Jan 1 1970 at midnight GMT.
    • X for a timestamp in “unix in seconds” format, also known as “epoch” or “unix timestamp”, which is defined as the count of seconds since Jan 1 1970 at midnight GMT.

    Examples

    • If start is “1/2/2016” and format is “D/M/Y” then output is 2016-02-01T00:00:00.000Z
    • If start is “1/2/16” and format is “M/D/YY” then output is 2016-01-02T00:00:00.000Z
    • If _start _is “1493053116” and format is “X” then output is 2017-04-24T16:58:36.000Z
    • If you want to convert from a date from the Twilio connector, which uses RFC2822 format, set format to “ddd, DD MMM YYYY HH:mm:ss Z”.  For example, that will convert a Twilio date of “Wed, 30 Nov 2016 03:17:37 +0000” to the Date format of “2016-11-30T03:17:37.000Z”
  • UNIX

    Converts a date & time to the number of milliseconds that have elapsed since January 1, 1970 (midnight UTC/GMT) not counting leap seconds, which is the standard date format for some systems. (See Epoch to use the number of seconds elapsed instead of milliseconds.)

    Input Fields

    • start: (required) the date & time you want to convert.

    Output Fields

    • output: the date & time in unix format: milliseconds since January 1, 1970, midnight UTC/GMT, not counting leap seconds.

    Example

    If _start_ is 2016-09-07T00:01:25.670Z then output is 1473206485670

    If you need the UNIX format for the current date and time, use a Now card and drag/drop the date field from the Now card into the start field on the UNIX card.