Commit 05c586c2 authored by Kristian Tan's avatar Kristian Tan

Format date for db

parent 83bb5a04
......@@ -72,7 +72,7 @@ def toggle_pin(change_pin):
if GPIO.input(change_pin) == 0:
message += " off."
if pins[change_pin]['on_time'] is not None:
start_time = pins[change_pin]['on_time']
start_time = str(pins[change_pin]['on_time'])
elapsed = str(datetime.now() - start_time)
date = datetime.strptime(start_time, '%Y-%m-%d').date()
entry = DailyUsage(date=date, on_time=elapsed)
......
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