After fixing the indentation, clicking Save raises a KeyError. Looks like you forgot to post the code where you assign a value to st.session_state["entryDate"].
…sorry this was copy/paste error, my original code is more complex.
However, that st.write renders correct and that extracting the same session object to a dict returns something completely different was confusing. It would be helpful in the doc explaining what python object is returning exactly, and what happens under the hood during rendering.
so
birthDate = st.date_input(“Birthday”, min_value=datetime.date(1910, 2, 1), format=‘DD/MM/YYYY’, key=‘birthDate’)
when entering 02/10/1987 you get:
st.write(st.session_state[‘birthDate’]) → Output for example 02-10-1987 (as expected)
That is because st.write actually calls st.json when passed a dictionary, then st.json serializes its argument as JSON. Instances of datetime.date are serialized to their string representation using repr (not str), which is what you are seeing.