Skip to content

Commit

Permalink
update time format
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Li committed Nov 3, 2024
1 parent e0c2df7 commit eb9cc5d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions wastewater_qpcr_app/wastewater_qpcr_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@ def init_page(pathogen):
latest_time = ti

if latest_time:
t_obj = time.localtime(latest_time)
os.environ["TZ"] = "MT"
time_stamp = time.strftime("%Y-%m-%d %H:%M:%S MT", t_obj)
import pytz
from datetime import timezone, datetime, timedelta
utc_dt = datetime.fromtimestamp(ti, tz=timezone.utc)
mt_timezone = pytz.timezone('America/Denver')
time_stamp = utc_dt.astimezone(mt_timezone).strftime('%Y-%m-%d %H:%M:%S MT')
else:
time_stamp = "Unknown"

Expand Down

0 comments on commit eb9cc5d

Please sign in to comment.