Spaces:
Sleeping
Sleeping
File size: 419 Bytes
60f94ea | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | from datetime import datetime as dt
from pytz import timezone
# EU/Rome timezone
EU_ROME_TZ = timezone("Europe/Rome")
def get_current_time():
"""
Returns the current date and time (Europe/Rome timezone).
"""
rome_now = dt.now(EU_ROME_TZ).strftime("%d/%m/%Y %H:%M:%S")
return rome_now
def timestamp_to_hms(timestamp):
return dt.fromtimestamp(timestamp, tz=EU_ROME_TZ).strftime("%H:%M:%S")
|