Skip to content

Streamlit component that returns the user browser IANA timezone

License

Notifications You must be signed in to change notification settings

parente/streamlit-tz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6583914 · Jul 12, 2024

History

3 Commits
Jul 12, 2024
Jul 12, 2024
Jul 12, 2024
Jul 12, 2024
Jul 12, 2024
Jul 12, 2024
Jul 12, 2024
Jul 12, 2024
Jul 12, 2024
Jul 12, 2024

Repository files navigation

streamlit-tz

Streamlit component that returns the user browser IANA timezone

Installation instructions

pip install streamlit-tz

Usage instructions

from datetime import datetime, UTC
from zoneinfo import ZoneInfo

import streamlit as st
from streamlit_tz import streamlit_tz


tz = streamlit_tz()
now = datetime.now(UTC)
st.write(f"Time UTC: {now}")
st.write(f"Time in {tz}: {now.astimezone(ZoneInfo(tz))}")