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

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

Tags..  C Programming  Date() and Time()
Posted by: Mahesh sharma | Views: 192 | Community Opinion: 1

Add Your Opinion

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
Your Name:
*your opinion/answer: