Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Digital_clock/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# πŸ•’ Digital Clock GUI

A simple digital clock built using **Python** and **Tkinter** that shows the current time and date, updating automatically every second.

## πŸš€ Features
- Displays real-time **HH:MM:SS** format
- Shows **current date**
- Updates automatically every second
- Clean and minimal UI

## πŸ§‘β€πŸ’» Tech Stack
- **Python**
- **Tkinter**
34 changes: 34 additions & 0 deletions Digital_clock/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import tkinter as tk
import time
from datetime import datetime

# Create main window
root = tk.Tk()
root.title("Digital Clock")
root.geometry("400x200")
root.resizable(False, False)
root.config(bg="#1e1e1e")

# Time label
time_label = tk.Label(root, text="", font=("Segoe UI", 48, "bold"), fg="#00ff99", bg="#1e1e1e")
time_label.pack(pady=20)

# Date label
date_label = tk.Label(root, text="", font=("Segoe UI", 16), fg="#ffffff", bg="#1e1e1e")
date_label.pack()

# Function to update time and date
def update_clock():
current_time = time.strftime("%H:%M:%S")
current_date = datetime.now().strftime("%A, %d %B %Y")

time_label.config(text=current_time)
date_label.config(text=current_date)

root.after(1000, update_clock) # Update every 1 second

# Start the clock
update_clock()

# Run the application
root.mainloop()