diff --git a/rfidLoginSystem.py b/rfidLoginSystem.py index 52369d0..0bfd527 100644 --- a/rfidLoginSystem.py +++ b/rfidLoginSystem.py @@ -581,14 +581,14 @@ def log_attendance(service_key, name, id_num): last_cell = cell_list[-1] last_row_num = last_cell.row last_row = sheet_tab.row_values(last_row_num) - last_logged_date = dt.datetime.strptime(last_row[0], "%m/%d/%y %H:%M %p") + last_logged_date = dt.datetime.strptime(last_row[0], "%m/%d/%y %I:%M %p") today = dt.date.today() if today == last_logged_date.date(): if len(last_row) == 4: # They logged in today so log them out sheet_tab.update_cell( - last_row_num, 5, current_time.strftime("%m/%d/%y %H:%M %p") + last_row_num, 5, current_time.strftime("%m/%d/%y %I:%M %p") ) time_diff = current_time - last_logged_date hours_logged = int(time_diff.seconds / 3600) @@ -603,7 +603,7 @@ def log_attendance(service_key, name, id_num): # They haven't logged in today, so log them in OR... # User never logged in. Just add it. sheet_tab.append_row( - [current_time.strftime("%m/%d/%y %H:%M %p"), id_num, name, "General Meeting"] + [current_time.strftime("%m/%d/%y %I:%M %p"), id_num, name, "General Meeting"] ) return f"{name} is logged in." @@ -613,7 +613,7 @@ def log_visitor(service_key, name, team): current_time = dt.datetime.now() sheet_tab = google_sheet.worksheet("SCRA Visitor Attendance") sheet_tab.append_row( - [current_time.strftime("%m/%d/%y %H:%M %p"), team, name, "SCRA Open Meeting"] + [current_time.strftime("%m/%d/%y %I:%M %p"), team, name, "SCRA Open Meeting"] )