Skip to content

The duration field: reads h:mm, stores seconds

Type 1:30, 1m 24s or 90s and Tabla stores seconds, which keeps sums and averages exact. The three formats (h:mm, h:mm:ss, mm:ss) and the API shape.

Updated November 2026

A duration is a length of time, such as how long a delivery window is or how long a call took. You read and type it as hours and minutes, and Tabla stores it as a single number of seconds. In the demo plant shop, Delivery window on the Orders table shows 2:00, and the stored value is 7200.

Adding a duration field: the Format select offering 1:30 and 1:30:00 in the field editor.

One option

Format sets how the cell reads:

  • 1:30: hours and minutes (h:mm), the default.
  • 1:30:00: hours, minutes and seconds (h:mm:ss), for durations where you need the seconds.
  • 1:24: minutes and seconds (mm:ss), for short durations like a track, a drill or a call. In this format the minutes keep counting past the hour, so ninety minutes reads 90:00 and no hour goes missing.

A value with seconds, shown in h:mm, is displayed rounded to the minute. The stored seconds are untouched, and switching the format shows them again.

Typing durations

If you write the units, there is nothing to interpret. 1m 24s, 90s, 2h, 2h30, 1.5h and 1h 2m 3s all mean what they look like, in any format.

A value with colons is read by the format you picked. 1:30 in an h:mm field is an hour and a half, and 1:24 in an mm:ss field is a minute and twenty-four seconds. Three parts, as in 0:01:24, are always hours, minutes and seconds, so that shape works in every format.

A bare number is read in the smallest unit the format displays. 90 in an h:mm field means 90 minutes (1:30), and in an h:mm:ss or mm:ss field it means 90 seconds, so what you type matches what you're looking at.

Arabic-Indic digits are read as digits: ١:٢٤ is the same as 1:24.

An entry that can only be partly understood is refused, so 1m 24x does not become one minute. A typo that can't be parsed leaves the current value as it was, and negative durations are refused.

Why durations are stored as seconds

Sixty is a terrible base for arithmetic, so Tabla never does arithmetic in it. Every duration is one number of seconds, which means summaries, filters, sorts, and rollups are plain numeric operations whose results are displayed as time. Sum 0:45 and 0:45 and the footer says 1:30, because Tabla added 2700 and 2700 and formatted 5400 as a time. Nothing is parsed when a value is read, so nothing can round oddly or drift.

Blank cells behave as they do in any number field. Sum and Average skip them, and they are never counted as 0:00. Filtering compares seconds, so is greater than with 3600 finds everything over an hour.

Over the API

The API uses seconds in both directions:

{ "fields": { "Delivery window": 7200 } }

A read always returns a number of seconds, which you format yourself. A write accepts a number of seconds or a colon string, so sending "1:30" stores 5400. A negative value is refused with Field "Delivery window" can't be negative. Clear with null.

This differs from typing in the grid. Over the API a bare number is always seconds, whatever the display format. The smallest-displayed-unit rule applies only on screen.

When it's the wrong field

  • A moment: "delivered at 14:30" is a point in time, not a length of it. Use a date field with time on.
  • Days-long spans: the largest unit the display has is hours (36:00, not 1 day 12:00). The value is still correct, but keep it in mind before you store project durations. A plain number of days may read better.
  • Derived spans: if the duration is "Deliver by minus Placed," store the two dates and let a formula do the subtraction.

Duration shares the numeric column with the others in the number family, so converting to a plain number is free, and the cells then show the seconds. Converting to text writes what you were reading instead (1:30). Converting a text field into a duration reads 1:30, 2h30 and 90s, and reads a bare number as seconds, the same rule as the API.

About Tabla

Tabla is a no-code database with Postgres underneath. Every feature is on every plan, you get a million records per database, and you can export your whole database in one file any day.

More guides