Social Icons

Friday, 3 May 2013

Time Using Strftime Function


#include<unistd.h>
#include<time.h>
#include<stdio.h>
int main()
{
time_t t1,t2;
struct tm *tm_ptr;
int m,p,u;
char *n;
char buf[256];
time(&t1);

tm_ptr=localtime(&t1);

strftime(buf,256,"%A:%d:%B:%I:%S:%p",tm_ptr);
printf("\n time is %s",buf);

return 0;
}

No comments:

Post a Comment

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management