File size: 458 Bytes
554d9d9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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()
|