Date time input
The date time input collects a calendar date and time in the active frontend timezone. Validation
returns a CarbonImmutable.
DateTimeInput::make('starts_at', 'Starts at')- autoFocus:false
- columnWidth:"md"
- conditions:null
- convertTimezone:false
- dependsOnAny:false
- dependsOnKeys:null
- disabled:false
- editablePrefill:false
- helperText:null
- label:"Starts at"
- labelAction:null
- max:null
- min:null
- name:"starts_at"
- prefillRefreshOn:null
- prefillResetOn:null
- readOnly:false
- required:false
- step:null
- tabIndex:null
- timezone:null
- tooltip:null
- value:null
Timezone behavior
Section titled “Timezone behavior”The picker uses the authenticated user’s timezone when the user model implements
HasTimezonePreference (preferredTimezone()), falling back to the browser timezone. Submitted
values include that timezone, so validation returns a CarbonImmutable in the user’s timezone by
default.
DateTimeInput::make('starts_at', 'Starts at');To store the value in the app timezone, opt in:
DateTimeInput::make('starts_at', 'Starts at') ->convertTimeZone();To convert to a specific timezone, pass it explicitly:
DateTimeInput::make('starts_at', 'Starts at') ->convertTimeZone('UTC');Common options
Section titled “Common options”DateTimeInput shares label, default value, required, disabled, read-only, and visibility options
with every field — see Fields. For validation and conditional behavior,
see Validation and Conditional fields.