C Program To Get The System Time and Date

C language  Program To Get The System Time and Date using  < Time.h>

[c]

#include<stdio.h>
#include<time.h>
int main()
{
char *date;
time_t timer;
timer=time(NULL);
date=asctime(localtime(&timer));
printf("date:%s",date);

}

[/c]

OR

[c]

#include <stdio.h>
#include <time.h>

int main()
{
time_t now;
time(&now);
printf("It’s %s", ctime(&now));
return 0;
}

[/c]

Share

About the Author

Akash Padhiyar

Visit Website

There are no comments yet, add one below.

Leave a Comment

Your email address will not be published. Required fields are marked *

*

Time limit is exhausted. Please reload CAPTCHA.