st.time_input - Streamlit Docs
Show API reference for

Display a time input widget.

Examples

Example 1: Basic usage

import datetime
import streamlit as st

t = st.time_input("Set an alarm for", datetime.time(8, 45))
st.write("Alarm is set for", t)

Example 2: Empty initial value

To initialize an empty time input, use None as the value:

import datetime
import streamlit as st

t = st.time_input("Set an alarm for", value=None)
st.write("Alarm is set for", t)
star

Tip

Want a new st.time_input feature or found a bug? Browse open issues and react with a 👍 on the initial post of the ones that matter to you. Your votes help us prioritize what to work on next.

forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.