'Streamlit time input function doesn't support each single time

enter image description here

Is there any way to show the time menu like above on streamlit? This menu should show every single hour and minute. Other hand streamlit time input provides only pre defined time arrivals like 08:00 08:15 08:30 08:45 etc. I don't want this. How can I solve this problem?



Solution 1:[1]

  start = "00:00"
    end = "23:59"
    times = []
    start = now = datetime.datetime.strptime(start, "%H:%M")
    end = datetime.datetime.strptime(end, "%H:%M")
    while now != end:
        times.append(str(now.strftime("%H:%M")))
        now += datetime.timedelta(minutes=1)
    times.append(end.strftime("%H:%M"))
    st.multiselect('Departure hour:',times)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 murat taşçı