Jan 24, 2010 at 3:11pm Jan 24, 2010 at 3:11pm UTC
how to get the system time in c language....
for this program
time_t t;
time(&t);
printf("%s",ctime(&t));
the output will be like this .... sun jan 24 20:34:58 2010 (example).
but how to get those character (sun,jan) and integers (24,20,34,58,2010)...to the user defined variables and print them seperately....
means if we declare variables like this ....
char a[3],b[3];
int date,hrs,mins,secs,year;
then the day,month,day,hrs etc must be stored in the respected variables....
and to print those variables where ever we want....
please give program for this......
Jan 24, 2010 at 3:44pm Jan 24, 2010 at 3:44pm UTC
why the seconds are calculating from 1970 jan 1..... please clear my doubt.....