How can I get the current date or time of day in a C program?

please solve my problem and send me a program....

Mahesh sharma
Views: 638 | Community Opinion: 1

Tags..  C Programming  Date() and Time()

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 

Just use the time(), ctime(), localtime() and/or strftime() functions. Here is a simple example:
#include"stdio.h"
#include
int main()
{
time_t now;
time(&now);
printf("It's %.24s.\n", ctime(&now));
return 0;
}






What do you think? Add your opinion/answer
*Name
*your opinion/answer: