Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/parente/streamlit-tz
Streamlit component that returns the user browser IANA timezone
https://github.com/parente/streamlit-tz
Last synced: about 2 months ago
JSON representation
Streamlit component that returns the user browser IANA timezone
- Host: GitHub
- URL: https://github.com/parente/streamlit-tz
- Owner: parente
- License: mit
- Created: 2024-07-12T02:22:48.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-12T03:08:22.000Z (5 months ago)
- Last Synced: 2024-10-10T19:22:34.846Z (2 months ago)
- Language: PowerShell
- Size: 3.21 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# streamlit-tz
Streamlit component that returns the user browser IANA timezone
## Installation instructions
```sh
pip install streamlit-tz
```## Usage instructions
```python
from datetime import datetime, UTC
from zoneinfo import ZoneInfoimport streamlit as st
from streamlit_tz import streamlit_tztz = streamlit_tz()
now = datetime.now(UTC)
st.write(f"Time UTC: {now}")
st.write(f"Time in {tz}: {now.astimezone(ZoneInfo(tz))}")
```