Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 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))}")
```