Commit a3474ad6 authored by Kristian Tan's avatar Kristian Tan

Format date for db

parent 21dba144
......@@ -74,7 +74,7 @@ def toggle_pin(change_pin):
if pins[change_pin]['on_time'] is not None:
start_time = pins[change_pin]['on_time']
elapsed = str(datetime.now() - start_time)
start_date = datetime.strptime(str(start_time), '%Y-%m-%d').date()
start_date = datetime.strftime(start_time, '%Y-%m-%d').date()
entry = DailyUsage(date=start_date, on_time=elapsed)
db.session.add(entry)
db.session.commit()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment