Formulas for

Relative Time

Data Conversion1 credit/cellSheets · Excel
=VERVE("relativetimeformatter", "1609459200", "field", "target_date")

Humanize timestamps by the row. Turns each date into '2 hours ago'-style text — Google Sheets or Excel.

It's one of 250+ live sources you reach with a single =VERVE() function — served from APIVerve's production data engine, billed at 1 credit per resolved cell, and refreshed on whatever cadence you set. No API keys to wrangle, no scripts, no exports.

A real example — the input you type, and the values you can pull from it. Click any cell to see the formula behind it.

relativetimeformatter.xlsxsample data
B2fx=VERVE("relativetimeformatter", A2, "field", "target_date")
A
B
C
D
E
1
Timestamp
Target date
Reference date
Relative time
Is past
2
1609459200
2021-01-01T00:00:00Z
2025-12-16T22:28:24.459Z
4 years ago
TRUE
3
4
click any cell to see its formula1 credit / cell

Convert by the row

Fill =VERVE("relativetimeformatter", "1609459200", "field", "target_date") beside a column of input and get the converted value back for every row — a batch conversion done in one drag.

No parser, no export

Turn one format into another right in the cell instead of round-tripping through a script or an online tool.

Feed the next step

Pipe the converted value straight into the formula or chart that needs it.

The same function works in both apps — install once, sign in with your key, and type it into any cell.

Google SheetsAdd-on

Install from the Workspace Marketplace, then drop the formula into a cell. Autocomplete suggests the source and its fields.

=VERVE("relativetimeformatter", "1609459200", "field", "target_date")
Microsoft ExcelAdd-in

Same source, same arguments, same key — in Excel on desktop, the web, or mobile. Excel namespaces it as VERVE.CALL. Drag to fill a whole column.

=VERVE.CALL("relativetimeformatter", "1609459200", "field", "target_date")

Tune the result by adding name=value before the field argument — in any order. Leave one out and its default applies.

  • reference

    Reference time to compare against (default: current time)

    =VERVE("relativetimeformatter", "1609459200", "reference", "2024-06-01T00:00:00Z")
  • style

    Output style

    =VERVE("relativetimeformatter", "1609459200", "style", "short")

Add a field name as the last argument to land just that value in the cell.

  • Relative time
    =VERVE("relativetimeformatter", "1609459200", "field", "relative_time")
  • Primary unit
    =VERVE("relativetimeformatter", "1609459200", "field", "primary_unit")
  • Primary value
    =VERVE("relativetimeformatter", "1609459200", "field", "primary_value")
  • Target date
    =VERVE("relativetimeformatter", "1609459200", "field", "target_date")
  • Reference date
    =VERVE("relativetimeformatter", "1609459200", "field", "reference_date")
  • Is past
    =VERVE("relativetimeformatter", "1609459200", "field", "is_past")
  • Is future
    =VERVE("relativetimeformatter", "1609459200", "field", "is_future")
  • Difference ms
    =VERVE("relativetimeformatter", "1609459200", "field", "difference_ms")
  • All units
    =VERVE("relativetimeformatter", "1609459200", "field", "all_units")
  • All units › Years
    =VERVE("relativetimeformatter", "1609459200", "field", "all_units.years")
  • All units › Months
    =VERVE("relativetimeformatter", "1609459200", "field", "all_units.months")
  • All units › Weeks
    =VERVE("relativetimeformatter", "1609459200", "field", "all_units.weeks")

Relative Time, answered

Everything you need to wire it into a sheet.

How do I pull Relative Time into Google Sheets?
Install the VerveSheets add-on, sign in once with your key, and type =VERVE("relativetimeformatter", "1609459200", "field", "relative_time") into any cell. The "field" argument names the value you want back, so the cell resolves to a single number or string you can chart, sort, or feed into another formula.
What data can I pull from Relative Time?
Relative Time returns relative_time, primary_unit, primary_value, target_date and reference_date, plus 7 more — name any one of them as the "field" argument and that value lands in the cell. Leave the field out and the whole record spills into a two-column table instead.
Can I narrow what Relative Time returns?
Yes — Relative Time takes "reference" and "style" as optional inputs. They go in as "name", value pairs after the required ones, in any order, so =VERVE("relativetimeformatter", "1609459200", "reference", "2024-06-01T00:00:00Z") shapes the result without changing anything else.
Can I fill a whole column of Relative Time at once?
Yes. Put your timestamp values down a column and point the formula at the range — A2:A50 instead of A2 — and one call returns a value for every row. Dragging the formula down works too, but the range form is a single billed call per column rather than one per cell.
How many credits does each Relative Time cell cost?
Each resolved cell costs 1 credit. A cell only re-bills when it actually refreshes, so a sheet you aren't touching doesn't keep charging.
Does Relative Time work in Excel as well as Google Sheets?
Yes — same arguments, same key, same fields. Excel namespaces custom functions, so the call is =VERVE.CALL() there and =VERVE() in Google Sheets; nothing else about it changes.

Put Relative Time in your next spreadsheet. Add the extension, paste the formula, and the cell keeps itself current.

Scaling up?

Volume pricing, custom SLAs, and dedicated support for high-traffic teams.

Contact sales