datetime
The datetime widget renders every Date & Time field in Odoo. It is one of the rare widgets Studio exposes almost completely, and it hides an undocumented range-pairing ability.
| Studio name | Date & Time |
|---|---|
| Technical name | datetime |
| Field types | datetime |
| Views | form, list, kanban, calendar (default widget for datetime fields) |
| Also registered as | list.datetime, an autoresizing list variant; the same file also registers date and daterange |
| Module | web, present in every Odoo database |
| Used in core | 7 explicit occurrences across hr_holidays, l10n_in_ewaybill, mass_mailing, stock, website, mrp; implicitly it renders every datetime field |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | Yes, and unusually completely: Studio exposes most options as field properties |
| Alternatives | date, daterange, remaining_days, float_time |
What the Date & Time field does
What this means for your team
Setting it up in Odoo Studio (no code)
What Studio cannot do here
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
rounding | number | Minute steps proposed by the time selector, e.g. 15 for quarter hours. Forced to 0 when show_seconds is enabled so seconds become selectable.(default: 5) |
show_time | boolean | Set false to display only the date part of the stored datetime. List views also narrow the column width accordingly.(default: true) |
show_seconds | boolean | Shows seconds in the readable format and the picker. The component default was true in 18.0 and flipped to false in 19.0.(default: false) |
min_date | string | Earliest selectable date, as an ISO date or the literal word today. Earlier dates gray out in the picker. |
max_date | string | Latest selectable date, same format as min_date. |
warn_future | boolean | Displays a warning icon when the selected date lies in the future. |
min_precision | selection | Smallest unit the picker requires: days, months, years or decades. Month precision turns the field into a month picker. |
max_precision | selection | Largest unit the picker can zoom out to: days, months, years or decades. |
numeric | boolean | Switches display from the readable style (Jan 31) to the locale's numeric style (01/31) and adjusts list column widths.(default: false)(since Odoo 19.0) |
placeholder_field | field name | A field on the record supplying a dynamic placeholder; date-typed values are formatted with the widget's own format options.(since Odoo 19.0) |
start_date_field | field name | Undocumented on this widget: pairs another field as the range start, rendering both as one range input exactly like daterange. The paired field is auto-loaded and forced editable. |
end_date_field | field name | Undocumented on this widget: pairs another field as the range end. Declaring both pairing options warns in the console and start_date_field wins. |
always_range | boolean | Undocumented on this widget: keeps the full range input visible even when one side is empty. Read by extractProps for all three registrations in the file.(default: false) |
Seconds interact with the time interval. When show_seconds is enabled the picker's rounding is forced to 0 so seconds become selectable; otherwise rounding applies with its default of 5 minutes. And one inheritance quirk: setting a datetime field's placeholder through placeholder_field formats date values with the widget's own format options, so a date-typed placeholder renders like a value, not like raw text.
Working examples
Formatting rules that surprise people
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Option set unchanged in the development branch; internals rewritten. See below. |
| Odoo 19.0 | Verified | Adds numeric and placeholder_field, removes condensed, flips the seconds default to hidden. Verified against the shipped source. |
| Odoo 18.0 | Verified | Same core options plus the now-removed condensed; seconds shown by default. |
| Odoo 17.0 | Verified | Widget present under the same registration; option set close to 18.0. |
| Odoo 16.0 | Verified | Widget present; registered directly as a component class in the pre-descriptor style. |
Upgrade note for 18 to 19. Three differences: seconds display flipped from default-on to default-off, the condensed option was removed, and numeric plus placeholder_field were added. Views setting removed or new options migrate silently; the seconds flip is the one users actually notice.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| Seconds disappeared after upgrading to Odoo 19 | The component's default flipped from showing to hiding seconds in 19.0. Add options="{'show_seconds': True}" on the views that need them. |
| The time dropdown only offers 5-minute steps | That is the default rounding. Set options="{'rounding': 1}" for every minute, or a larger value for coarser steps. Typing an exact time always works. |
| Users pick dates in the wrong year | No guard rails on the picker. Set min_date and max_date, in Studio via Earliest and Latest accepted date, using an ISO date or today. |
| The value shows a different time than was entered | Datetimes are stored in UTC and rendered in each user's timezone; a wrong user timezone shifts every display. Check the user's timezone in their preferences; the stored data is almost certainly correct. |
| A range shows only a time on the right side | Both values fall on the same day, so the widget compresses the second one to time-only by design. No fix needed; the full date reappears when the values span days. |
| Console warns about start_date_field and end_date_field | Both pairing options are set on the same field, which the source explicitly warns against. Keep exactly one; the widget ignores end_date_field when both are present. |
Date & Time field vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
datetime | A single moment in time with date and clock | Timezone-aware picker with configurable precision, steps and limits |
date | Calendar days without a time component | Same component, date type only, no time selector |
| daterange | Periods with a start and end | Declares the pairing options officially and adds cross-field validation |
| remaining_days | Deadlines read as urgency | Renders In 5 days instead of the date itself |
| float_time | Durations rather than moments | Formats float hours as HH:MM, no calendar involved |
Frequently asked questions
How do I change the minute steps in Odoo's time picker?+
How do I show only the date of a datetime field?+
Why did my Odoo forms stop showing seconds after migrating to 19?+
Can I restrict which dates users can pick?+
Can the plain datetime widget show a start and end date together?+
Does show_seconds affect what is stored?+
What is the numeric option on date and datetime fields?+
Will the datetime widget change in Odoo 20?+
Scheduling screens that fight your operators?
Pickers stepping in the wrong intervals, timezones shifting deliveries, seconds cluttering approval trails: datetime friction compounds across a workday. We tune Odoo's time handling from view options to timezone policy so entering a date stops being a chore.
Book a free consultation