Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
609 B
2
Indexable
Never
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)
Leave a Comment