Add datetime input
Problem
The st.date_input() is not taken into account the time in the widget. We can only select : day, month, year. In order to bypass this limitation, I’m using st.text_input, next I convert it into full datetime format (I don’t want to use st.slider(), It’ s ugly).

Solution
The purpose is to add time selection in the widget like this :

Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.
If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.
Thanks for sharing this suggestion, @Pydetect ! This is a cool idea. Hopefully, community members will upvote this request so we can prioritize it appropriately.
We have st.time_input. You can use it in combination with st.date_input to create a datetime input. I know it's a bit annoying to use 2 widgets for such a simple case though 😉 We have a proper datetime input on the roadmap but we probably won't get to it very soon. The problem is that the underlying UI library we use (BaseWeb) does not have a datetime input, so we'd need to do a more complex custom implementation.
As you said, it's lead to use two widgets, this is exactly what I'm looking to avoid. Everything in streamlit is building from the top to the bottom linearly of the window, less we have widgets, more is better.
One of the high value of streamlit is precely the ergonomy, it's hightlight a clear dashboard. I hope a solution will be find.
+1 to this :)
This would be useful, exactly what I'm looking for right now.
+1 It's very useful. 😄
+1. Would be great!
- Is datetime as one input not yet relesed?
This would be useful, exactly what I'm looking for right now.
You can use this:
pip install streamlit-datetime-range-pickerfrom streamlit_datetime_range_picker import datetime_range_picker
st.subheader('Date Range Picker')
date_range_string = date_range_picker(picker_type=PickerType.time.string_value,
start=-30, end=0, unit=Unit.minutes.string_value,
key='range_picker',
refresh_button={'is_show': True, 'button_name': 'Refresh last 30min',
'refresh_date': -30,
'unit': Unit.minutes.string_value})
if date_range_string is not None:
start_datetime = date_range_string[0]
end_datetime = date_range_string[1]
st.write(f"Date Range Picker [{start_datetime}, {end_datetime}]")
The output will look like this.
When you tap on it, it displays this. :
If you have any questions about Streamlit, please feel free to contact me at any time.Linkedin
Problem
The st.date_input() is not taken into account the time in the widget. We can only select : day, month, year. In order to bypass this limitation, I’m using st.text_input, next I convert it into full datetime format (I don’t want to use st.slider(), It’ s ugly).
Solution
The purpose is to add time selection in the widget like this :
Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.
If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.
https://github.com/streamlit/streamlit/issues/6089#issuecomment-1908413981
This would be useful, exactly what I'm looking for right now.
You can use this:
pip install streamlit-datetime-range-pickerfrom streamlit_datetime_range_picker import datetime_range_pickerst.subheader('Date Range Picker') date_range_string = date_range_picker(picker_type=PickerType.time.string_value, start=-30, end=0, unit=Unit.minutes.string_value, key='range_picker', refresh_button={'is_show': True, 'button_name': 'Refresh last 30min', 'refresh_date': -30, 'unit': Unit.minutes.string_value}) if date_range_string is not None: start_datetime = date_range_string[0] end_datetime = date_range_string[1] st.write(f"Date Range Picker [{start_datetime}, {end_datetime}]")The output will look like this.
When you tap on it, it displays this. :
If you have any questions about Streamlit, please feel free to contact me at any time.Linkedin
I tried this out - and it flickered my entire screen. Cool idea, not quite ready though.
+1
+1 please
+1
+1
+1
+1 PS: Initial comment why this ist not implemented:
The problem is that the underlying UI library we use (BaseWeb) does not have a datetime input, so we'd need to do a more complex custom implementation.
However, BaseWeb has now a Ui component for date + time. See example Calendar with time select actions
+1
+1
+1
+1
+1
+1
Update
Hey all, we just built a prototype for this (see #13014). You can try out the wheel file here. If you try this out, please let us know how it works for you or if there's anything you'd like to see changed. We might need a bit of time to bring this over the finish line because we're busy with other projects, but I hope we'll get it within the next few weeks/months :)
https://github.com/user-attachments/assets/0b3ed263-6cef-4d25-9e88-4931bf1f97b9
Update
This will be available in the next release (1.52, early December) as st.datetime_input. Let us know if there are any other requests for this!
When you tap on it, it displays this. : 