> ## Content Index
> Fetch the complete content index at: https://airtables.net/llms.txt
> Use this file to discover other available public pages before exploring further.

# Airtable DATETIME_DIFF: days, decimal hours and Duration
- URL: https://airtables.net/airtable-datetime-diff/
- Published: 2026-11-10T17:53:23.000Z
- Updated: 2026-11-23T19:52:01.000Z
- Description: Choose whole days, decimal hours or an h:mm duration, with blank-safe formulas and clear expected results.
- Author: Emma Hayes
- Tags: Formulas

Use `DATETIME_DIFF({End}, {Start}, "days")` for whole elapsed days between two Airtable dates. For decimal hours, calculate seconds and divide by 3600; for a Duration display such as 1:30, keep the result in seconds. I'd choose the counting rule before formatting the field, because elapsed hours, calendar dates and billing periods can give different correct answers for the same two timestamps.

## Build a blank-safe date-difference field

This calculation is available on every Airtable plan. Creating or changing a Formula field requires Owner or Creator permissions, as shown in Airtable's [date-difference guide](https://support.airtable.com/articles/8381355254-calculating-the-difference-between-dates-in-airtable?ref=airtables.net). Work in a new field first so existing reports and automations keep their current inputs while you check the result.

1. Open the table holding both dates. Add or identify Date fields named **Start** and **End**.
2. Enable the time in both fields if the interval depends on hours or minutes. Include the actual end date for an overnight interval.
3. Click **+** to add a field, choose **Formula** and name it **Elapsed days**.
4. Paste the expression below, replacing the field names with yours.
5. Choose a numeric output format, then click **Create field** or **Save**.

```
IF(
  AND({Start}, {End}),
  DATETIME_DIFF({End}, {Start}, "days"),
  BLANK()
)
```

With Start on April 10 at 9:00 AM and End on April 12 at 9:00 AM in the same zone, the expected result is 2\. With either date empty, the guarded expression leaves the result blank. An incomplete record therefore won't look like a completed zero-day task.

`DATETIME_DIFF(date1, date2, "units")` subtracts the second date from the first. A negative result flags a reversed interval. Even a zero in a large unit can cover two different timestamps. To check their exact order, use `IS_BEFORE({End}, {Start})` inside the same guard for missing dates. Airtable's [function reference covers both date comparisons](https://support.airtable.com/articles/7330071120-airtable-formula-field-functions-reference?ref=airtables.net). The [Formula field guide](https://airtables.net/airtable-formula-basics/) explains braces and field references if the expression won't save.

[![Airtable DATETIME_DIFF uses End first and checks that both dates are present](https://storage.ghost.io/c/a9/2c/a92c670f-47cf-4c4a-afab-8582761151cb/content/images/2026/11/airtable-guide-diff-create.webp)](https://storage.ghost.io/c/a9/2c/a92c670f-47cf-4c4a-afab-8582761151cb/content/images/2026/11/airtable-guide-diff-create.webp?ref=airtables.net)

Recognize the argument order before checking the count. A missing input leaves the result blank. [View full size](https://storage.ghost.io/c/a9/2c/a92c670f-47cf-4c4a-afab-8582761151cb/content/images/2026/11/airtable-guide-diff-create.webp?ref=airtables.net).

## Choose whole units, decimal hours or a Duration

`DATETIME_DIFF` returns whole integers for every supported unit. Showing more decimal places changes the display, not the precision already discarded. To retain a partial hour, use a smaller unit before dividing.

__Choose the calculation and the output format together__
| What you need                   | Core expression                                   | Output format              |
| ------------------------------- | ------------------------------------------------- | -------------------------- |
| Whole days                      | DATETIME\_DIFF({End}, {Start}, "days")            | Number                     |
| Whole minutes                   | DATETIME\_DIFF({End}, {Start}, "minutes")         | Number                     |
| Decimal hours                   | DATETIME\_DIFF({End}, {Start}, "seconds") / 3600  | Number with decimal places |
| Decimal 24-hour periods         | DATETIME\_DIFF({End}, {Start}, "seconds") / 86400 | Number with decimal places |
| Hours and minutes, such as 1:30 | DATETIME\_DIFF({End}, {Start}, "seconds")         | Duration, h:mm             |

Wrap the chosen core expression in the two-date guard above when records can be incomplete. For 9:00 AM to 10:30 AM on one date, the expected results are 90 minutes, 1 whole hour and 0 whole days. None includes a fractional unit.

### Return 1.5 decimal hours

```
IF(
  AND({Start}, {End}),
  DATETIME_DIFF({End}, {Start}, "seconds") / 3600,
  BLANK()
)
```

Select a numeric format with decimal places. The ninety-minute example gives 5400 / 3600 = 1.5\. Airtable also documents [minutes divided by 60](https://support.airtable.com/articles/8381355254-calculating-the-difference-between-dates-in-airtable?ref=airtables.net); that's sufficient when whole-minute precision matches the job. Seconds retain sub-minute intervals. Display rounding and a rule such as charging for every started quarter-hour are separate decisions; label the field with the rule your report uses.

### Display 1:30 without turning the result into text

```
IF(
  AND({Start}, {End}),
  DATETIME_DIFF({End}, {Start}, "seconds"),
  BLANK()
)
```

Open the Formula field's **Formatting** tab, choose **Duration** and select **h:mm**. Airtable's [Duration field instructions](https://support.airtable.com/articles/8465756875-duration-fields-in-airtable?ref=airtables.net) confirm that the underlying value is seconds regardless of its display. Here 5400 displays as 1:30\. A result of 90 would represent ninety seconds, not ninety minutes.

Keep the formula numeric if another field will total or compare it. Appending `& " hours"` produces a text label and removes Duration formatting. Use the field name or description for the unit instead.

[![Airtable grid shows 5400 seconds, 1.5 hours, and Duration displayed as 1:30](https://storage.ghost.io/c/a9/2c/a92c670f-47cf-4c4a-afab-8582761151cb/content/images/2026/11/airtable-guide-diff-duration-results.webp)](https://storage.ghost.io/c/a9/2c/a92c670f-47cf-4c4a-afab-8582761151cb/content/images/2026/11/airtable-guide-diff-duration-results.webp?ref=airtables.net)

The seconds and Duration fields can represent the same numeric result. A separate decimal-hours field divides seconds by 3600\. [View full size](https://storage.ghost.io/c/a9/2c/a92c670f-47cf-4c4a-afab-8582761151cb/content/images/2026/11/airtable-guide-diff-duration-results.webp?ref=airtables.net).

## Use a supported unit, with its exact capitalization

Airtable's [unit-specifier list](https://support.airtable.com/articles/2945640011-supported-datetime-diff-unit-specifiers-in-airtable?ref=airtables.net) supports the following names and abbreviations. I'd use full names in shared formulas: someone maintaining `"minutes"` is less likely to mistake it for months.

__DATETIME\_DIFF units__
| Full name    | Abbreviation | Full name | Abbreviation |
| ------------ | ------------ | --------- | ------------ |
| milliseconds | ms           | seconds   | s            |
| minutes      | m            | hours     | h            |
| days         | d            | weeks     | w            |
| months       | M            | quarters  | Q            |
| years        | y            |           |              |

Lowercase `"m"` means minutes; uppercase `"M"` means months. Put the unit in straight quotation marks and spell it explicitly rather than depending on what a missing or misspelled unit might do.

## Separate elapsed time from calendar-day counting

An interval from April 10 at 11:30 PM to April 11 at 12:30 AM lasts one hour. It crosses one calendar-date boundary, and touches two dates if both endpoints count. A whole elapsed-day result of 0 doesn't answer either calendar question.

For elapsed time, keep the original timestamps and choose seconds, minutes or hours. For a calendar-day rule, decide which time zone defines the dates, then reduce both timestamps to dates in that zone. Don't shift an actual timestamp just to make the result resemble a calendar count.

### Count local calendar-date boundaries

Create two helper Formula fields named **Start calendar date** and **End calendar date**. For timestamps whose reporting calendar is New York, use:

```
IF(
  {Start},
  DATETIME_PARSE(
    DATETIME_FORMAT(SET_TIMEZONE({Start}, "America/New_York"), "YYYY-MM-DD"),
    "YYYY-MM-DD"
  ),
  BLANK()
)
```

Use the same expression in **End calendar date**, replacing `{Start}` with `{End}`. Replace the zone in both helpers if your reporting calendar is elsewhere. This combines Airtable's documented [SET\_TIMEZONE, DATETIME\_FORMAT and DATETIME\_PARSE pattern](https://support.airtable.com/articles/7730575816-timezones-and-locales-in-airtable?ref=airtables.net): format the local date as text, then parse that date for arithmetic.

These helpers deliberately discard the time. They represent date labels for counting, not corrected versions of the original instants. Set their date display to GMT/UTC so the parsed date isn't displayed as the previous day in another zone. Then calculate:

```
IF(
  AND({Start calendar date}, {End calendar date}),
  DATETIME_DIFF({End calendar date}, {Start calendar date}, "days"),
  BLANK()
)
```

The overnight example now gives 1\. If your rule counts both the start and end dates and End is on or after Start, add 1 to this normalized day difference: one same-day booking becomes 1, and April 10–11 becomes 2\. Reject or flag reversed ranges before applying that inclusive rule. Adding 1 to an arbitrary timestamp difference doesn't establish the right calendar or fix a bad input.

[![Airtable date-difference example gives zero elapsed days and one local date boundary](https://storage.ghost.io/c/a9/2c/a92c670f-47cf-4c4a-afab-8582761151cb/content/images/2026/11/airtable-guide-diff-midnight.webp)](https://storage.ghost.io/c/a9/2c/a92c670f-47cf-4c4a-afab-8582761151cb/content/images/2026/11/airtable-guide-diff-midnight.webp?ref=airtables.net)

These timestamps are 40 minutes apart. Whole elapsed days and local calendar boundaries answer different questions. [View full size](https://storage.ghost.io/c/a9/2c/a92c670f-47cf-4c4a-afab-8582761151cb/content/images/2026/11/airtable-guide-diff-midnight.webp?ref=airtables.net).

### Check daylight-saving boundaries with the right rule

A local calendar day can span 23 or 25 elapsed hours where clocks change. Keep original timestamps for actual elapsed work or an hour-based SLA; use the date helpers for a calendar-day count. Airtable's [time-zone guidance](https://support.airtable.com/articles/7730575816-timezones-and-locales-in-airtable?ref=airtables.net) distinguishes DST-aware `America/New_York` from a fixed-offset zone. A hard-coded four- or five-hour adjustment isn't a year-round substitute for the named zone.

## Count complete months or compare reporting months

`DATETIME_DIFF({End}, {Start}, "months")` asks for a whole-unit interval between dates. It doesn't ask how many month headings a report crosses. Don't replace it with days / 30 or years with days / 365; those are fixed-length approximations with different rules.

If January 31 to February 1 should count as one reporting-month step, compare the year and month of the normalized date helpers:

```
IF(
  AND({Start calendar date}, {End calendar date}),
  12 * (YEAR({End calendar date}) - YEAR({Start calendar date}))
    + MONTH({End calendar date}) - MONTH({Start calendar date}),
  BLANK()
)
```

This returns 1 for January to February and 1 for December to the following January; two dates in the same reporting month return 0\. It is a bucket difference, not elapsed tenure or a count of billable months. A label such as “1 year, 3 months, 15 days” needs a separate rule for remainder months, month-end dates and inclusive endpoints; don't obtain it by dividing a single day count into 365s and 30s.

## Calculate days remaining, elapsed age or overdue status

For days remaining until a date-based deadline, keep the deadline first:

```
IF({Due date}, DATETIME_DIFF({Due date}, TODAY(), "days"), BLANK())
```

For whole days since a stored date, reverse the direction:

```
IF({Start}, DATETIME_DIFF(TODAY(), {Start}, "days"), BLANK())
```

Use `NOW()` when the current time of day matters. For “has this exact deadline passed?”, compare the timestamps directly instead of testing whether a whole-day count is negative:

```
IF(
  {Due date},
  IF(IS_BEFORE({Due date}, NOW()), "Overdue", "Not overdue"),
  BLANK()
)
```

A deadline can be overdue by an hour while its whole-day difference is still 0\. If “today” must mean the team's local calendar date, derive it from `NOW()` with the same local-date normalization used above, then compare date labels.

Airtable refreshes TODAY and NOW when the base loads or the formula recalculates, and periodically while the base is open. In a closed base, the [function reference describes an approximately hourly refresh](https://support.airtable.com/articles/7330071120-airtable-formula-field-functions-reference?ref=airtables.net) when time-dependent automation or sync depends on it. Configure a separate [reminder automation](https://airtables.net/airtable-email-automation/) to send a message when a deadline is near.

## Fix errors by checking the input type first

__Diagnose the result before changing the counting rule__
| Symptom                             | Likely check                                                    | What to do                                                                                     |
| ----------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| 0 for a short interval              | The requested unit is larger than the interval                  | Use seconds or minutes, then divide if a decimal result is required.                           |
| A negative number                   | End comes before Start                                          | Check the argument order and the stored dates, including the date of an overnight shift.       |
| NaN, an error, or swapped month/day | Text instead of a structured date                               | Parse the actual input format explicitly; changing the field's display alone won't parse text. |
| Wrong value from a related table    | A lookup contains a list, or a formula converted a date to text | Select the intended related date and keep a structured date for calculation.                   |
| Duration looks far too small        | Minutes or decimal hours were formatted as seconds              | Return seconds before choosing Duration.                                                       |
| The date looks a day out            | Time-zone display or an incorrectly entered timestamp           | Show both inputs with their times and compare each field's zone configuration.                 |

For a text field containing `2026-04-10`, `DATETIME_PARSE({Start text}, "YYYY-MM-DD")` creates the date input. Match the format to the real data, not to how you want the result to look. `DATETIME_FORMAT` goes in the opposite direction: it produces text. Keep the date for arithmetic and put a readable label in a separate field; see the [date-formatting guide](https://airtables.net/airtable-datetime-format/).

Airtable's [lookup documentation](https://support.airtable.com/articles/8927322518-lookup-field-overview?ref=airtables.net) explains that lookup values arrive as an array. Choose what one related date means before calculating. If it means the latest linked completion, create a Rollup field named **Latest end**, select the linked records and their completion Date field, and use `MAX(values)`. A rollup is the documented [way to produce one latest-date answer](https://support.airtable.com/articles/6341452677-choosing-how-to-model-your-data-in-airtable?ref=airtables.net) from linked records.

Also create **Related end count**, rolling up the same Date field with `COUNTA(values)`. The [rollup reference](https://support.airtable.com/articles/7497685062-rollup-field-overview?ref=airtables.net) distinguishes counting non-empty values from counting every linked record, and warns that empty rollups are treated as true by AND. Use the count to guard the calculation:

```
IF(
  AND({Start}, {Related end count} > 0),
  DATETIME_DIFF({Latest end}, {Start}, "days"),
  BLANK()
)
```

Select the earliest date instead if that's the rule the workflow needs. Don't join several dates into a string and parse the combined text. The [lookup diagnostic](https://airtables.net/airtable-lookup-not-showing-values/) covers missing links and unexpected values.

If the inputs are Duration fields, they contain lengths in seconds rather than dates. For **Actual duration** and **Planned duration**, use `{Actual duration} - {Planned duration}` for seconds, or divide that subtraction by 60 for minutes. A zero duration is a valid value, so don't apply a date-style truthiness guard that treats zero as missing.

For zone problems, open each Date field's configuration and compare **Use the same time zone for all collaborators** and the selected zone. Displaying the same instant in two zones doesn't create elapsed time between them. Correct any upstream import assumption if the stored timestamp itself is wrong.

## Check the field with ordinary, empty and boundary records

Use the following expected cases with your own field names before a report, reminder or billing workflow reads the result. Each clock-time pair uses the same zone unless a different rule is named.

__Expected results for the selected rule__
| Inputs                                        | Expected result                                                             |
| --------------------------------------------- | --------------------------------------------------------------------------- |
| 9:00 AM → 10:30 AM, same date                 | 90 minutes; 1 whole hour; 1.5 decimal hours; 5400 seconds; 1:30 as Duration |
| Identical Start and End                       | 0; an inclusive same-date booking counts 1 only under that separate rule    |
| End one hour before Start                     | \-60 minutes; inspect or flag the reversed range                            |
| Either Date input empty                       | Blank with the guarded recipes                                              |
| 11:30 PM → 12:30 AM next date                 | 1 elapsed hour; 0 whole elapsed days; 1 normalized calendar-day boundary    |
| December 31 → January 1, reporting-month rule | 1 month bucket, including the year change                                   |

For working-day counts, use [WORKDAY\_DIFF](https://airtables.net/airtable-workday/); ordinary DATETIME\_DIFF doesn't exclude weekends. To return a new deadline rather than an interval, use [DATEADD](https://airtables.net/airtable-dateadd/). For a date-difference field, stop when the normal, empty and boundary records match the rule named in that field.