ksvmuralidhar commited on
Commit
06e6108
·
verified ·
1 Parent(s): 323992a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -172,8 +172,9 @@ def index():
172
  else:
173
  # last_update_utc = datetime.strptime(os.getenv("NEWSFETCHTIME"), '%Y-%m-%d %H:%M:%S.%f')
174
  last_update_utc = datetime.strptime(redis_client.get('NEWSFETCHTIME'), '%Y-%m-%d %H:%M:%S.%f')
175
- last_update_utc = last_update_utc.strftime("%Y-%m-%d %H:%M:%S")
176
- result_str += f'<p class="srctxt">News aggregated from <b>{src_str}</b>.<br><br>Last updated: {last_update_utc} UTC</p>'
 
177
 
178
  result_str += '''
179
  <div class="input-container">
 
172
  else:
173
  # last_update_utc = datetime.strptime(os.getenv("NEWSFETCHTIME"), '%Y-%m-%d %H:%M:%S.%f')
174
  last_update_utc = datetime.strptime(redis_client.get('NEWSFETCHTIME'), '%Y-%m-%d %H:%M:%S.%f')
175
+ # last_update_utc = last_update_utc.strftime("%Y-%m-%d %H:%M:%S")
176
+ last_update_mins = str(int(np.round((dt.now(dt.tz) - last_update_utc).total_seconds() / 60, 0)))
177
+ result_str += f'<p class="srctxt">News aggregated from <b>{src_str}</b>.<br><br>Updated {last_update_mins} mins ago</p>'
178
 
179
  result_str += '''
180
  <div class="input-container">