🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 30, 2026

How to Add a Duration Field to Gravity Forms (Length of Time, Not a Clock Time)

GravityExtra
How to Add a Duration Field to Gravity Forms (Length of Time, Not a Clock Time)

Plenty of forms need to capture an amount of time. How long was the job? How long should we book the room for? How much time did you spend on the task? What is the estimated effort for this request? Gravity Forms is excellent at collecting a clock time with its Time field — a point in the day, like 9:00 am — but out of the box it has no field for a length of time. People end up bolting a duration onto a single-line text box (“2 hours 30 mins”), or splitting it across two number fields and stitching the pieces back together later. Both approaches are fiddly, and neither gives you a value you can sort, filter or add up. The Gravity Forms Duration Field add-on fixes that with a proper field for a length of time.

A duration is not a clock time

It is worth drawing the distinction clearly, because it is the whole point of the field. A clock time answers “when?” — the appointment starts at 9:00 am. A duration answers “how long?” — the appointment lasts two and a half hours. They look similar on screen, but they behave very differently once stored. A clock time wraps around at midnight and is tied to a day; a duration is simply a count — of minutes, in this add-on’s case — that can be zero, a few minutes, several hours or many days, and can be added, compared and averaged like any other number. If you have ever tried to total a column of “1h 45m” text values, you already know why storing a duration as a real number matters.

Three ways to ask

Different forms want to ask for a duration in different ways, so the field offers three input styles. The first is hours and minutes: two small boxes, each labelled, which suits most service and booking forms. The second is days, hours and minutes: three boxes for longer spans such as rental periods or project estimates. The third is a single number and a fixed unit: one box where the unit is minutes, hours or days, which is the quickest option when you only ever want, say, a number of hours. You choose the style per field, so one form can have a “session length” in hours and minutes and a “hire period” in days on the same page.

The Duration field on a Gravity Form, showing hours and minutes boxes with a live total preview
Hours-and-minutes style, with a live total preview under the field.

A live preview as the visitor types

Whichever style you pick, the field shows a running total underneath as the visitor types — “Total: 2h 30m” — so there is no ambiguity about what they have entered. The preview is purely a convenience; the value that counts is worked out again on the server when the form is submitted. You can turn the preview off for a particular field if you prefer a barer layout.

Stored as minutes, so it actually behaves like a number

When the form is submitted, the add-on combines the parts into a single whole number of minutes and stores that. This is the quiet feature that makes everything else work. Because the entry holds a number, the Entries list sorts durations correctly — shortest to longest — instead of alphabetically. Filters on the duration behave sensibly. And the value is available to calculations and conditional logic, so you can price by the hour, flag anything over a threshold, or branch the form when the requested duration is long. You never have to parse a text string back into a number again.

Friendly on the outside, numeric underneath

Storing minutes would not be much use if every screen then showed a bare “150”. So everywhere the duration is displayed — the Entries list, the single entry screen, and your notifications and confirmations — it is rendered in a friendly, readable form such as “2h 30m” or “1d 4h”. Your team reads the human form; your reports read the number. You get both from the same field without doing anything special.

Merge-tag modifiers for the shape you need

The field’s merge tag outputs the friendly form by default, but sometimes a message or an onward system wants a different shape. Three modifiers cover that. Adding :minutes to the tag — for example {Duration:4:minutes} — outputs the raw number of minutes, which is ideal for a spreadsheet column or an API payload. :long outputs “2 hours 30 minutes” for a more formal message. :colon outputs “2:30” for a compact, timesheet-style look. You can mix them freely across notifications, confirmations and routing rules.

Limits that are enforced where it matters

Most durations have sensible bounds. A session might need to be at least thirty minutes and at most eight hours, booked in fifteen-minute steps. The field lets you set a minimum, a maximum and a step — all expressed in minutes — and, crucially, it checks them on the server, not only in the browser. A live preview and a few HTML attributes make the form pleasant to fill in, but they are easy to get around; the real check runs when the submission is processed. If the combined duration is below the minimum, above the maximum, or not a whole multiple of the step, the field is rejected with a clear message, and an unreadable entry (such as minutes above fifty-nine) is rejected too. A visitor who turns off scripting or posts to the form directly cannot slip an out-of-range value past it.

The Duration field in days, hours and minutes mode on a Gravity Form, with a live total preview
The days, hours and minutes input style, with a live total preview.

Where a duration field earns its keep

Once you have a real duration field, uses turn up everywhere. Service businesses capture how long a job will take and price it by the hour with a calculation. Studios and venues take a booking length and feed it into availability or totals. Agencies and freelancers log time against tasks and sum it later. Support and operations teams record how long an incident lasted. Equipment hire and rentals ask for a period in days. Even simple intake forms benefit: “roughly how long have you had this problem?” is far more useful as a number you can segment on than as free text.

Built the GravityExtra way

The add-on is GravityForms-first. There is no third-party service to sign up for, no API key to paste in, and no outside connection of any kind beyond the usual licence and update check with gravityextra.com. The only data it handles is the duration the visitor enters, kept as a plain number of minutes with the entry. It works with multi-page forms, conditional logic and calculations, and it sits in the Advanced Fields group where you would expect to find it.

Getting started

Install and activate the add-on, add your licence key under Forms → Settings → Duration Field, then drop a Duration field onto a form from the Advanced Fields group. Pick the input style that fits, set a minimum, maximum and step if you want them, and add the field’s merge tag to a notification — with :minutes if a system downstream needs the raw number. Send a test submission and watch the duration appear, neat and numeric, in the entry. If your forms have ever needed to ask “how long?”, this is the field that finally answers it properly.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr