Smart Clock & Formatter
Your task for today is to build a Python script that prints a mini time dashboard for “right now.” You’ll practice working with datetime
, formatting strings, and user input while exposing multiple useful time representations for everyday scripts.
📝 Project Task
The program should:
Show the current local date/time in two formats, e.g.
Monday, August 11, 2025 – 14:35
ISO 2025-08-11 14:35:00
Provide a 12h/24h toggle via user input (e.g.,
12
or24
).Display the ISO week number and the day of year.
Print the date with an ordinal day, e.g.,
August 11th, 2025
.
This is a practical way to master Python’s date/time APIs and produce clean, readable outputs for dashboards or logs.
📌 Expected Output
When you run the program, it should ask whether you want 12h or 24h format, then print a dashboard similar to:
Choose time format (12/24): 24
Current Local Time (Verbose): Monday, August 11, 2025 – 14:35
Current Local Time (ISO): 2025-08-11 14:35:00
ISO Week Number: 33
Day of Year: 223
Date with Ordinal: August 11th, 2025
If the user chooses 12
, the verbose time should display in hh:mm AM/PM
format (e.g., 02:35 PM
).
💬 Join the Weekly Python Chat
Need help or want to share what you built? Join this week’s Python Chat Thread to:
Ask questions
Share your solution
Get feedback
Find study partners
💻 Launch This Project in Colab
Open the interactive Google Colab notebook for today’s project — with full instructions, hints, and solutions.
Click the button below to start coding — no setup needed: