The Date and Time field allows adding dates and timestamps to your content. Ideal for creation and publishing dates, as well as appointments and other events.
Editing UI Widget
This field is displayed as a button which opens a calendar widget, allowing you to select a date and a time (if the
showTime option is enabled). The field is labelled by its
label and shows the currently selected date and time in a human readable format, as well as a button to reset the value to
null if the
removable option is enabled.
The Unformatted Text field outputs the text as a string or number depending on which
outputFormat is selected.
The following options are available for this field (default values shown):
outputFormat: dates can either be stored as ISO-formatted strings or UNIX timestamps, i.e. the number of seconds that has passed since Jan. 1st 1970
removable: whether or not the set date may be removed, resetting the value of the field to
showTime: whether to show a time selector in addition to the date selector
defaultToNow: if set to
truethe default value of the field will be the time the content item was created by default
useAsUpdatedAt: if set to
truethe field will be set to the current date and time whenever the content item being edited is saved, unless it is the first time it is being edited, determined by the presence of the
___mb_uneditedfield, or it is a draft. Date fields with this option enabled will override any date input by the user and will not be validated, so you likely want to mark it as hidden as well.
only: if set to either “past” or “future” controls whether only dates in the future or past may be selected respectively
The following validation options are available for this field (default values shown):
A hidden Date and Time field with
defaultToNow set to
true is a great way to have a record of when a particular content item was created.
outputFormat is set to
"iso", the time string will be in the timezone of the user editing the file.
Version at launch: 2