Skip to content
  1. Extras
  2. PageBuilder
  3. Field types
  4. Free
  5. datetime

Field datetime

Version: Free.

Why this type

Date and time in one calendar, not two fields. The saved value is an ISO-like string, so you can sort it. That avoids the mismatches you get from separate date and time fields.

When to use

  • Promo start with exact hour
  • Scheduled news publish
  • Countdown or timer on a landing

Tips

Day-only needs date. Format for display in the chunk or a snippet.

Similar types

  • date when time is irrelevant
  • time when date lives elsewhere

Schema

json
{
  "name": "starts_at",
  "type": "datetime",
  "label": "Date and time",
  "tab": "Content",
  "width": 100,
  "active": true
}

Value

datetime-local string.

Section data

Key starts_at in the section data (datetime-local string):

json
{
  "starts_at": "2026-08-24T14:30"
}

Chunk example

modx
<time datetime="[[+starts_at]]">[[+starts_at]]</time>
fenom
<time datetime="{$starts_at|escape}">{$starts_at|escape}</time>

Common properties

For fields with name that are stored in the section data:

KeyTypeRoleCMP
tabstringGroup subtitle in the inspectoryes
width25–100Field width as % of the row (flex)yes
descriptionstringHint under the labelyes
defaultanyInitial value for a new sectionyes
activeboolfalse hides the field in the inspectoryes
requiredboolRequired on publish (draft still saves)yes

See fields overview.

See also