This is a simple C++ program that displays the current day, hour, month, and year in the console using the ctime and Windows.h
libraries. The program retrieves the system time using the Windows.h
library and then formats it using the ctime library to display the current date and time in a human-readable format. The output is displayed in the console window.
- Displays current hour, day, month, and year
- Customizable console text color using
Windows.h
library
$ g++ main.cpp -o output
$ ./output
This code uses the Windows.h
library to manipulate console text attributes. It may not be compatible with all systems.
Feel free to contribute by forking the repository and making pull requests.