# Can't edit format for st.date\_input

**URL:** <https://discuss.streamlit.io/t/cant-edit-format-for-st-date-input/47748>\
**Category:** Using Streamlit\
**Created:** [July 23, 2023, 11:03am UTC](https://discuss.streamlit.io/t/cant-edit-format-for-st-date-input/47748 "2023-07-23T11:03:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ville](https://avatars.discourse-cdn.com/v4/letter/v/dec6dc/32.png) [@Ville](https://discuss.streamlit.io/u/Ville)\
**Post date:** [July 23, 2023, 11:03am UTC](https://discuss.streamlit.io/t/cant-edit-format-for-st-date-input/47748/1 "2023-07-23T11:03:35Z")

</div>

I want to try to edit the format of st.date\_input.

but I get this error message: “TypeError: TimeWidgetsMixin.date\_input() got an unexpected keyword argument ‘format’”

```auto
from datetime import date, datetime
import streamlit as st
add_event = 0

if st.button("Add Event"):
    add_event = 1

if add_event == 1:
    st.text_input("What's the name of your event?")
    new_event = st.date_input("When is your event?", format="DD/MM/YYYY")

```

please help!

---

<div class="post-metadata">

**Author:** ![edsaac](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/edsaac/32/47599_2.png) [@edsaac](https://discuss.streamlit.io/u/edsaac)\
**Post date:** [July 23, 2023, 2:12pm UTC](https://discuss.streamlit.io/t/cant-edit-format-for-st-date-input/47748/2 "2023-07-23T14:12:30Z")

</div>

The `format` kwarg was recently introduced in version 1.25.0, my guess is that you are working with a previous version of streamlit. You can upgrade via pip:

```sh
pip install -U streamlit

```

---

<div class="post-metadata">

**Author:** ![Ville](https://avatars.discourse-cdn.com/v4/letter/v/dec6dc/32.png) [@Ville](https://discuss.streamlit.io/u/Ville)\
**Post date:** [July 23, 2023, 4:06pm UTC](https://discuss.streamlit.io/t/cant-edit-format-for-st-date-input/47748/3 "2023-07-23T16:06:20Z")

</div>

Great! Thank you! Now it works, however, I’d like it to be the last to digits of the year (this year: 23) and streamlit doesn’t support that format, do you know any other way to remove the first two digits of the year? Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [January 19, 2024, 4:06pm UTC](https://discuss.streamlit.io/t/cant-edit-format-for-st-date-input/47748/4 "2024-01-19T16:06:48Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
