Intro
The time picker component lets users select a localized time using touch, mouse, or keyboard input in 12-hour or 24-hour format. Users can either type a time directly or use the visual clock face to choose hours, minutes, and seconds.
Time picker
Component availability
The component is available in the following libraries:
When to Use
Use the time picker to:
- Enable users to select a time.
- Enable users to select a time range. In this case, one time picker can be used to set the starting time and a second one to set the end time.
Don’t use the time picker to:
- Let users select a standard duration, such as 15 minutes, 30 minutes, 1 hour, or 2 hours. In this case, use the select component instead.
- Use the time picker input field to let users enter a time value by typing it.
- Use the basic time picker for users who work with or prefer the 24-hour format.
- Use the time picker with an AM/PM switch for users who are accustomed to the 12-hour format.
- Hide the seconds field by default and add it only when it is relevant for the use case.
- Use an icon button, text button, or link to trigger open the time picker popover when space is limited or when required by the application logic.
- Provide tooltips for the time picker button and the clock selection interface to improve clarity and discoverability.
- Set a default time to display an initial value in both the input field and the popover.
- Enable the input mask to guide users and help prevent invalid entries.
- Keep interaction consistent across devices, including desktop, tablet, and smartphone.
- Use compact mode on desktop and cozy mode on mobile and tablet to match the device context.
Anatomy
Time picker input filed
- Time picker input field: The container in which a user enters data. It could contain a mask.
- Time picker button: The button that opens the time picker popover.
Time picker input field anatomy
Time picker popover
- Time picker container
- Hours field: Displays the hour entered or selected.
- Minutes field: Displays the minutes entered or selected.
- Seconds field (optional): Displays the seconds entered or selected.
- AM/PM switch: The switch is displayed if the user has opted for the 12-hour format.
- Clock face for selecting the time: The appearance of the clock face depends on the focus (hours, minutes, or seconds) and the time format (12-hour or 24-hour clock).
- Footer: Displays OK and Cancel buttons.
Time picker popover anatomy
Clock face
- Clock face circle: The circular container that defines the clock’s shape and holds all interactive elements.
- Tick marks: Visual indicators that help users read and select precise time values.
- Number selector: Numeric values shown sequentially around the clock face that users select a specific hour, minute, or second value.
- Selected hours/minutes/seconds: Highlights the currently chosen value on the clock face.
- Hours/minutes/seconds label: Displays the unit currently being edited (hours, minutes, or seconds).
Time picker clock face
Types
The time picker supports two formats: the 12-hour format with AM/PM, and the 24-hour format.
A. Time picker with AM/PM switch is best suited for users who are accustomed to AM/PM time.
B. Basic time picker works best for users who are used to and prefer the 24-hour format.
Time picker types
States
The time picker incorporates various states to ensure a clear and intuitive user experience, enhancing both interaction and status validation. Each state visually communicates the component's current status and supports user navigation.
Component states
A. Enabled: The component is interactive.
B. Disabled: The component is visible but not interactive.
C. Read-only: The component is visible and its value can be read, but not edited.
Time picker component states
For more information, see Component States.
Interaction states
The time picker has five interaction states: regular, hover on input, hover on button, active input, and active button, that represent different parts of the component.
A. Regular: The default state of the input field and the button.
B. Hover on input: When the cursor hovers over the input field.
C. Hover on button: When the cursor hovers over the time picker button.
D. Active: The input field is focused, allowing the user to enter or edit the time.
E. Active button: The time picker button is active, displaying the calendar.
Time picker interaction states
For more information, see Interaction States.
Value states
The time picker input supports four value states that describe the status of the entered value:
A. Negative: Indicates an invalid time value.
B. Critical: Indicates a time value that requires attention.
C. Positive: Indicates a valid time value.
D. Information: Signals neutral status or context without implying errors or warnings.
Time picker value states
Value states with value state messages
When users enter a time in the input field, the time picker displays value state messages that indicate whether the entered time is valid or requires attention. When they trigger the popover, the value state message also appears there.
Note: The positive state does not display a value state message.
Time picker value state messages
For more information, see Value States.
Focus state
The focus state indicates which element is focused. When the popover with the clock interface is opened, the focus goes to hours and minutes field and then to the footer buttons. The clock face circle reflects the time entered in the fields, but it doesn’t receive the focus state.
A. Unfocused state applies to all units that are not focused.
B. Focused state is visualized by an additional border around the input field, the time outputs inside the time picker popover, or the footer actions.
Unfocused and focused states for the time picker
For more information, see Focus States.
Selection state
The selection state is applied after the user selects an element. The selected element is clearly distinguished from the other elements.
A. Unselected: The state occurs when an element is not selected, displaying the element in its regular (default) state.
B. Selected: The state shows that an element is selected and visually differs from the unselected state.
Time picker selection states
For more information, see Selection States.
Behavior and Interaction
Users can set the time in two ways:
- Enter a time directly in the input field.
- Select a time using the time picker popover.
Entering a time in the input field
Users can manually enter the time directly into the input field. On desktop devices, the user selects the time input field and enters the time using the keyboard.
A. Shows placeholder text when no value has been entered.
B. Displays an active input field ready to take user input.
C. Shows the selected or typed time after entry is complete.
Time picker input field with mask
Time selection with the time picker popover
When the user chooses the time picker button (A), the component opens a popover with the clock selection interface (B). Time can be entered by typing directly into the hours and minutes fields or by selecting values from the clock interface. The popover fields display the current time by default.
To adjust the time, users can click the clock face circle or a tick mark to pick a value, or drag along the clock face for more precise adjustment. Once a value is chosen (B), the view automatically moves to the next time unit in the sequence (C). Focus shifts to the corresponding field, which enters its toggled state. If the last unit has been selected, the view does not change further.
The interaction pattern is consistent across desktop, tablet, and mobile. After a time value is chosen, the view automatically advances to the next segment in the sequence, or remains on the final segment if it is the last one. To adjust a previously selected value, users can simply select the corresponding time field. Clicking or tapping OK button in the footer confirms the selection, while choosing Cancel or clicking or tapping outside the popover discards all changes.
Time picker button and popover interaction
Opening the time picker from another component :badge, info, large, _, SAPUI5 Only:
The time picker can be triggered by another component such as text button, icon button, or link. In this case, the time picker popover opens without the input field.
Opening time picker popover from another component
Tooltip
The time picker component supports tooltips for the button, the time fields, and the input field.
Tooltips on the time picker button and minutes field
Responsiveness
Time picker sizes
The time picker is responsive and adapts to different devices. The examples below show how the component adjusts its size and layout based on screen resolution and interaction type. Use cozy mode for sizes S and M, and compact mode for size L and above.
Touch devices size S and M
Time picker input field
Tapping the input field on mobile devices opens an additional popover. To set the value, the user enters the desired value into each input field using the native mobile keyboard and switches between AM/PM within the popover. Footer actions confirm or abort the chosen time value.
Time picker input popover in cozy mode
Time picker popover on smartphones
Tapping the time picker button opens the time picker popover. On smartphones, the popover expands into a full screen dialog. Users can select a time by dragging the handle around the dial or by tapping the tick marks on the clock face circle. The chosen value is displayed in the time field at the top.
The interaction pattern is the same as on desktop. After a time value is chosen, the view automatically advances to the next segment in the sequence, or remains on the final segment if it is the last one. To adjust a previously selected value, users can tap the corresponding time field.
The time picker then waits for the user’s confirmation in the footer to close the dialog and apply the selected time. Tapping OK finalizes the chosen value and writes it back to the input field. Tapping Cancel, or tapping outside the popover, closes the dialog without applying any changes.
Time picker in size S in cozy mode
Time picker popover on tablets
On tablets, the time picker opens as a standard overlay popover, following the same interaction pattern as described above.
Time picker in size M in cozy mode
Desktop devices size L
The time picker appears as a popover when the time picker button is triggered. Use compact mode on desktop to support mouse and keyboard interaction.
For more information, see Content Density (Cozy and Compact).
Accessibility
SAP follows international standards, such as WCAG and WAI-ARIA, and strives to make our business solutions accessible and inclusive.
For more information, see Accessibility in SAP Fiori and the Accessibility Design Tools Handbook.
Keyboard navigation
The following keyboard combinations are supported by the SAPUI5 time picker component.
Screen reader support
For details on screen reader support and Accessible Rich Internet Applications (ARIA), see UI5 Screen Reader Support and WAI-ARIA Authoring.
Content
Placeholder
The time picker displays a placeholder that shows the expected time format.
A: Time picker in h∶mm format
B: Time picker in HH∶mm∶ss format.
C: Time picker with a custom placeholder.
Time picker with different format patterns
Time picker clock faces
The time picker supports different clock faces that adapt based on the active time unit.
A. Hours face: Displays when the user first opens the time picker, allowing hour selection.
B. Minutes face: Appears after the user selects an hour, enabling precise minute input.
C. Seconds face (optional): Can be included for use cases requiring second-level precision.
Time picker hours, minutes, and seconds clock faces
Default Time
You can set a default time, which appears as the initial value in the time input field and the time picker popover. If you don’t set it at the application level, the control defaults to the current time. Users can modify the initial value.
Time input shortcuts
When there is no mask in the input field, a specific time can be entered via the shortcuts:
- "now"
- “in x hour”
- “x hour ago”
After typing in the shortcut and pressing Enter, the time is automatically calculated and entered.
Using shortcuts in the time picker input
Display format
You can customize the time format displayed in the input field using Unicode LDML time formats. Supported formats include full, long, medium, and short patterns, as well as specific custom patterns. These formats automatically adapt to different locales – for example, switching between 12-hour and 24-hour notation or using locale-specific separators and symbols.
Examples of different display formats
For more information, see UTS #35: Unicode Locale Data Markup Language.
Time zone
If the user has to set a time that is time zone-sensitive, offer a select control next to the time picker control to choose the appropriate time zone. For more information, see Formatting Time.
Localization
The time picker supports left-to-right (LTR) and right-to-left (RTL) reading directions.
Left-to-right time picker
Right-to-left time picker
Features
24-hour support :badge, info, large, _, SAPUI5 Only:
Time picker 24 hours
Minutes and seconds step :badge, info, large, _, SAPUI5 Only:
The time picker allows configuration of step values for both minutes and seconds. By default, time values increase or decrease by 1 unit (1 → 2 → 3). However, apps can define a custom step increment, such as 5 or 15, to skip intermediate values. For example, if the minute step is set to 5, the sequence will follow 0 → 5 → 10 → 15, and so on.
Time picker with minutes step set to 5
Current time :badge, info, large, _, SAPUI5 Only:
The button appears inside the time selection view and offers a quick way for users to return to "now" without needing to scroll or manually adjust the fields.
Note: The current time button is optional and must be enabled by the app team based on the use case.
Time picker with current time button
Мask in the input field :badge, info, large, _, SAPUI5 Only:
Time picker with input mask
You can disable the integrated mask input feature, but we strongly recommend using it. Only disable mask input if you need to make an exception for your use case (for example, if a variable-length format is required for a specific locale).
Framework Comparison
The table below summarizes the differences between SAPUI5 and SAP Web Components and lists the framework-specific patterns.
[internal_only] To request these features for SAP Web Components, submit an InnerSource request.[/internal_only]
Related Links
Implementation
SAPUI5
Time Picker (Samples)
Time Picker (API reference)
SAP Web Components
Time Picker
UI Kit (Figma)
SAP Fiori for Web UI Kit / Time Picker