mirror of
https://git.sdf.org/tamservo/robottas.git
synced 2025-11-12 09:03:47 -05:00
Fixes for time to next event / race.
This commit is contained in:
10
load_schedule.py
Normal file → Executable file
10
load_schedule.py
Normal file → Executable 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()
|
||||
|
||||
Reference in New Issue
Block a user