A beautiful ASCII art digital clock that displays the current time and date in your Windows console. The clock features large, stylized numbers and automatically centers itself in the console window.
- Large ASCII Art Display: Time is shown using beautiful ASCII art characters
- Real-time Updates: Clock updates every second
- Auto-centering: Automatically centers the display in your console window
- Date Display: Shows the current date above the time
- Dynamic Console Sizing: Automatically resizes the console window to fit the clock
- HH:MM:SS Format: Displays hours, minutes, and seconds with colons
The clock displays time in a format like this:
Friday, July 4, 2025
000000000 1111111 000000000 333333333333333 1111111 999999999
00:::::::::00 1::::::1 00:::::::::00 3:::::::::::::::33 1::::::1 99:::::::::99
00:::::::::::::00 1:::::::1 00:::::::::::::00 3::::::33333::::::3 1:::::::1 99:::::::::::::99
0:::::::000:::::::0 111:::::1 0:::::::000:::::::0 3333333 3:::::3 111:::::1 9::::::99999::::::9
0::::::0 0::::::0 1::::1 0::::::0 0::::::0 3:::::3 1::::1 9:::::9 9:::::9
0:::::0 0:::::0 1::::1 :::::: 0:::::0 0:::::0 3:::::3 :::::: 1::::1 9:::::9 9:::::9
0:::::0 0:::::0 1::::1 :::::: 0:::::0 0:::::0 33333333:::::3 :::::: 1::::1 9:::::99999::::::9
0:::::0 000 0:::::0 1::::l :::::: 0:::::0 000 0:::::0 3:::::::::::3 :::::: 1::::l 99::::::::::::::9
0:::::0 000 0:::::0 1::::l 0:::::0 000 0:::::0 33333333:::::3 1::::l 99999::::::::9
0:::::0 0:::::0 1::::l 0:::::0 0:::::0 3:::::3 1::::l 9::::::9
0:::::0 0:::::0 1::::l 0:::::0 0:::::0 3:::::3 1::::l 9::::::9
0::::::0 0::::::0 1::::l :::::: 0::::::0 0::::::0 3:::::3 :::::: 1::::l 9::::::9
0:::::::000:::::::0 111::::::111 :::::: 0:::::::000:::::::0 3333333 3:::::3 :::::: 111::::::111 9::::::9
00:::::::::::::00 1::::::::::1 :::::: 00:::::::::::::00 3::::::33333::::::3 :::::: 1::::::::::1 9::::::9
00:::::::::00 1::::::::::1 00:::::::::00 3:::::::::::::::33 1::::::::::1 9::::::9
000000000 111111111111 000000000 333333333333333 111111111111 99999999
ascii_clock.c- Main clock program source codeascii_clock.exe- Compiled clock executablegenerate_chars.c- Utility to generate ASCII character data from text filesgenerate_chars.exe- Compiled generator utilityascii_chars.h- Generated header file containing ASCII art datazero.txtthroughnine.txt- ASCII art templates for digits 0-9colon.txt- ASCII art template for the colon character
- Windows with Visual Studio Build Tools or Visual Studio installed
- Microsoft C/C++ Compiler (MSVC)
-
Open VS Developer CMD prompt
- Search for "Developer Command Prompt" in your Start menu
- Or open a regular command prompt and run
vcvars64.batfrom your Visual Studio installation
-
Navigate to project directory
cd "c:\Users\Steven\Github\WinWhen"
-
Compile the character generator
cl generate_chars.c /Fe:generate_chars.exe
-
Run the character generator (this creates
ascii_chars.h)generate_chars.exe
-
Compile the main clock program
cl ascii_clock.c /Fe:ascii_clock.exe
-
Run the clock
ascii_clock.exe
If you want to compile everything in one go:
cl generate_chars.c /Fe:generate_chars.exe && generate_chars.exe && cl ascii_clock.c /Fe:ascii_clock.exeSimply run the compiled executable:
ascii_clock.exe- The clock will automatically resize your console window to fit properly
- Press
Ctrl+Cto exit the program - The display updates every second with the current time
To customize the appearance of the digits:
- Edit the
.txtfiles (zero.txt,one.txt, etc.) with your preferred ASCII art - Recompile using the steps above (you must run
generate_chars.exeafter editing)
- Maximum character dimensions: 30 lines × 20 columns
- Supports digits 0-9 and colon character
- Uses Windows API for console manipulation
- Automatically calculates centering based on console width
- Windows operating system
- Console/Command Prompt
- Visual Studio Build Tools or Visual Studio (for compilation)
This project is licensed under the terms found in the LICENSE file.
Q: The clock doesn't display properly
- Make sure your console window is large enough
- Try running in full screen mode
- Ensure you have proper Windows console font settings
Q: Compilation errors
- Make sure you're using the Visual Studio Developer Command Prompt
- Verify all
.txtfiles are present in the directory - Check that
generate_chars.exeran successfully and createdascii_chars.h
Q: Clock appears off-center
- The program automatically calculates centering, but very narrow console windows may cause issues
- Try manually resizing your console window wider