Time functions

When you're building workflows in Tines, you'll often need to work with dates and times. Maybe you need to know the current date, format a timestamp for a report, or calculate how many days have passed since an order was placed. Time functions help you work with dates and times to track, calculate, and format temporal data.

Think of time functions as your calendar and clock tools. They help you capture the current moment, format dates the way you need them, and calculate time differences.

Tines offers time functions to handle common date and time tasks. We'll look at the following in this section:

  • NOW - Gets the current date and time.

  • DATE - Formats dates into readable text.

  • DATE_DIFF - Calculates the difference between two dates.

NOW: Get the current date and time 

The NOW function returns the current date and time in UTC (Coordinated Universal Time). This is useful when you need to timestamp an action, record when something happened, or use the current time in calculations.

Basic syntax 

NOW()

Example 

Let's say we are setting up a JSON to send over a report. Here's what our current HTTP Request action's (called "Send Report") Payload looks like:

{
  "id": "R-918",
  "name": "Features Released",
  "author": "Celeste Rourke",
  "date": ""
}

Before we run the action, we want to include the current date and time in the data. To do that, we execute the following formula via the Value pill for the "date" key:

NOW()

Then, when we run the action, the output includes the UTC date and time at execution:

{
  "send_report": {
    "id": "R-918",
    "name": "Features Released",
    "author": "Celeste Rourke",
    "date": "2025-11-21T20:34:54.536+00:00"
  }
}

DATE: Format dates into readable text 

The DATE function takes a date (from NOW, upstream data, or text) and formats it into a readable string. You can control exactly how the date appears using format codes.

Basic syntax 

DATE(date, format, timezone)

Example 

We have this invoice data from an upstream action called "Get Invoice":

{
  "id": "I-007",
  "amount": 15700,
  "date": "2025-11-21T22:47:01.777+00:00"
}

We want to send out an email to the team on this invoice, but first, we want to make sure that the date value is corrected to display the date in the format we want (DD/MM/YY). To do that, we execute the following formula via the Value pill in a downstream, connected action:

DATE(get_invoice.date, "%d/%m/%Y")
  • %d: Format specifier for day

  • %m: Format specifier for month

  • %Y: Format specifier for year

This results in the date format being fixed:

21/11/2025

💡Note

DATE_DIFF: Calculate time between two dates 

The DATE_DIFF function calculates the difference between two dates and returns detailed information about the time span, including years, months, weeks, days, hours, minutes, and seconds.

Basic syntax 

DATE_DIFF(start_time, end_time)

Example 

We have two dates in an upstream action called "Get Ticket":

{
  "id": "T-516",
  "title": "Potential malicious email",
  "severity": "high",
  "open_date": "2025-11-14T14:30:00.000+00:00",
  "close_date": "2025-11-21T16:00:00.000+00:00"
}

We want to determine how long it took from the time the ticket was opened to when it was resolved. To do that, we execute the following DATE_DIFF formula via the Value pill in a downstream, connected action:

DATE_DIFF(get_ticket.open_date, get_ticket.close_date)

The output includes an object with detailed information on the difference between the two dates, including different time measurements:

{
  "seconds": 610200,
  "minutes": 10170,
  "hours": 169.5,
  "days": 7.06,
  "weeks": 1.01,
  "units": {
    "years": 0,
    "months": 0,
    "weeks": 1,
    "days": 0,
    "hours": 1,
    "minutes": 30,
    "seconds": 0
  }
}

❗️Important

Was this lesson helpful?

Built by you,
powered by Tines

Already have an account? Log in.