Well... there are a few different ways you could do it that I guess would depend on what you want to do with the data later. Assuming you don't need that format stored anywhere a simple method would just be a series of:
cout << month << "/" << day << "/" << year << " " << hour << ":" << minute;
This of course does not take into account several factors like ensuring that 07 outputs as 07 and not just 7, etc...
I got that, but thanks. The program is compiled and works great. Now I'm finishing it up and making it a little more functional. ATM, my program is programed to output "8/2/2009 16:07" as the date/time. I would really like it to output the current date/time instead.
:
I found a code online but it outputs MM:DD:YY HH:MM:SS not MM:DD:YYYY HH:MM:SS
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <stdio.h>
#include <time.h>
int main( )
{
char dateStr [9];
char timeStr [9];
_strdate( dateStr);
printf( "The current date is %s \n", dateStr);
_strtime( timeStr );
printf( "The current time is %s \n", timeStr);
}