DateTimePicker

Combined date and time input with 5-6 editable fields and calendar icon.

Overview

DateTimePicker extends Control and combines date and time editing into a single control with five or six editable fields: year, month, day, hours, minutes, and optionally seconds. A calendar icon () is displayed alongside the fields. When no value is selected, customizable placeholder text is shown. Users navigate across all fields with Left/Right arrows, adjust values with Up/Down arrows, or type digits directly with auto-advance between fields. The control validates dates automatically — day values are clamped for the selected month and year, and time fields use wrapping arithmetic (e.g. hours wrap from 23 to 0).

Basic Example

<StackPanel Orientation="Vertical">
  <TextBlock Text="Select date and time:" />
  <DateTimePicker PlaceholderText="Pick date/time..." />
</StackPanel>

Properties

PropertyTypeDefaultDescription
SelectedDateTimeDateTime?nullThe currently selected date and time, or null if nothing is chosen.
ShowSecondsboolfalseWhen true, displays an additional seconds field (6 fields total).
Iconstring"\uF073"Nerd Font glyph displayed as the calendar icon.
PlaceholderTextstring"Select date/time..."Text shown when SelectedDateTime is null.
WidthSizeAutoExplicit width of the control.
HeightSizeAutoExplicit height of the control.
FocusColorColorCyanBorder color when the control has keyboard focus.
HoverColorColorYellowBorder color when the mouse hovers over the control.

Examples

Date and Time

<StackPanel Orientation="Vertical">
  <TextBlock Text="Meeting start:" />
  <DateTimePicker SelectedDateTime="2026-04-15T09:30" />
</StackPanel>

With Seconds

<StackPanel Orientation="Vertical">
  <TextBlock Text="Log timestamp:" />
  <DateTimePicker SelectedDateTime="2026-04-15T14:30:45"
                  ShowSeconds="True"
                  FocusColor="Green" />
</StackPanel>

Placeholder

<StackPanel Orientation="Vertical">
  <TextBlock Text="Event schedule:" />
  <DateTimePicker PlaceholderText="Choose event date and time..."
                  FocusColor="Magenta" />
</StackPanel>

Keyboard Shortcuts

KeyAction
Left ArrowMove focus to the previous field (seconds → minutes → hours → day → month → year).
Right ArrowMove focus to the next field (year → month → day → hours → minutes → seconds).
Up ArrowIncrement the focused field by one. Date fields are clamped; time fields wrap (23 → 0, 59 → 0).
Down ArrowDecrement the focused field by one. Date fields are clamped; time fields wrap (0 → 23, 0 → 59).
0–9Direct digit entry — auto-advances to the next field when the current field is full.

Key Concepts