Fixes for time to next event / race.

This commit is contained in:
tamservo
2023-12-25 17:01:09 -05:00
parent e960966a47
commit c91c0e6e05
2 changed files with 48 additions and 38 deletions

10
load_schedule.py Normal file → Executable file
View File

@@ -11,7 +11,7 @@ if __name__ == '__main__':
# Create the table
cur.execute("""create table schedule( id integer primary key, """ +
"""title, session_type, date_start INTEGER,""" +
"""title, session_type, date_start,""" +
"""location, round );""")
con.commit()
@@ -24,14 +24,10 @@ if __name__ == '__main__':
"date_start, location, round) VALUES(" + \
f"?, ?, ?, ?, ?)"
# Convert date into seconds
date_str = row[2]
date_obj = datetime.datetime.fromisoformat(date_str)
cur.execute(sql_line,
(row[0], row[1], date_obj.timestamp(), row[3], row[4])
(row)
)
con.commit()
cur.close()
con.close()
con.close()