#include <time.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
time_t current_time;
char* c_time_string;
current_time = time(NULL);
if (current_time == ((time_t)-1))
{
printf("Error in computing current time.");
return 1;
}
c_time_string = ctime(¤t_time);
if (NULL == c_time_string)
{
printf("Error in conversion of current time.");
return 1;
}
printf("Current time is %s", c_time_string);
getch();
return 0;
}