Download clock.py from theitguy/demo-app: direct link, hf CLI and curl.
- Browser
- Download file 458 Bytes
-
https://huggingface.co/spaces/theitguy/demo-app/resolve/main/clock.py
- Command line
-
hf download hf://spaces/theitguy/demo-app/clock.py
-
curl -L -o clock.py https://huggingface.co/spaces/theitguy/demo-app/resolve/main/clock.py
458 Bytes
| import datetime | |
| import pytz | |
| def display_ist_time(): | |
| # Set the time zone to IST | |
| ist = pytz.timezone('Asia/Kolkata') | |
| # Get the current time in IST | |
| current_time = datetime.datetime.now(ist) | |
| # Format the time as HH:MM:SS | |
| formatted_time = current_time.strftime("%H:%M:%S") | |
| # Print the current time in IST | |
| print(f"Current Time in IST: {formatted_time}") | |
| # Run the function to display the current time in IST | |
| display_ist_time() | |