Skip to content

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')

The picker uses the frontend timezone configured through lattice.i18n.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');

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.