I will give you an example of how to use "asctime" I got it from here
http://msdn.microsoft.com/library/en...._wasctime.asp
Code:
#include <ctime>
#include <cstdio>
struct tm *newtime;
time_t aclock;
int main()
{
time( &aclock ); // Get time in seconds
newtime = localtime( &aclock ); // Convert time to struct tm form
/* Print local time as a string */
printf( "Current date and time: %s", asctime( newtime ) );
/* Print Individual elements of time as a decimal */
/* Print Month as a decimal */
printf( "Month : %d \n", (1+(*newtime).tm_mon));
/* Print Day as a decimal */
printf( "Day : %d \n", (*newtime).tm_mday);
/* Print Year as a decimal */
printf( "Year : %d \n", (1900+(*newtime).tm_year));
return 0;
}