Code:
int main() { printf("\n Date 6 days : %s\n", functionName()); //Here u will get in full string format then u parce it and use the info what ever required. }// function last 6 days char *functionName() { char Date6[11]=NULL; time_t current,c6; struct tm *tm,*now; current = time(NULL); c6 = current - (6 * 3600 *24); now = localtime(&c6); //printf("Date is %02d/%02d/%02d\n", now->tm_mon+1, now->tm_mday,now->tm_year+1900); //printf("Time is %02d:%02d\n", now->tm_hour, now->tm_min); snprintf(Date6, sizeof(Date6), "%02d/%02d/%02d", now->tm_mon+1, now->tm_mday, now->tm_year+1900); return Date6; }
i want comment the printf and return date to the main function.
please help
help........
bye
madhu
Comment