Untitled

 avatar
unknown
plain_text
a year ago
609 B
4
Indexable
class AttendanceApp:
    def __init__(self, root):
        # Existing code...
        self.update_timestamp()  # Initial call to update the timestamp
        self.root.after(1000, self.update_timestamp)  # Schedule the update every 1000 milliseconds (1 second)

    def update_timestamp(self):
        # Update timestamp entry with current date and time
        current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
        self.timestamp_entry.delete(0, tk.END)
        self.timestamp_entry.insert(0, current_time)
        # Schedule the next update
        self.root.after(1000, self.update_timestamp)
Editor is loading...
Leave a Comment