How would I print the date and time for the purposes of the build. Ie: When the console for my application starts up I want to do this:
Binary B
One way of doing this would be using the built-in __DATE__
and __TIME__
macros. From MSDN (for VS 2005):
__DATE__
: The compilation date of the current source file. The date is a string literal of the form Mmm dd yyyy. The month name Mmm is the same as for dates generated by the library function asctime declared in TIME.H.
__TIME__
: The most recent compilation time of the current source file. The time is a string literal of the form hh:mm:ss.