I am reading a log file & storing the values into a structure
but while reading data from log & converting it into time value i am getting wrong values of date part but correct values for time part.
logdata is the pointer to struct mylog.
i checked with both ctime & asctime too both are giving wrong date part but correct time part
I checked that value coming in logdata->time_second = 347533824
I guess it should be 10 digits.
Am i correct .
Please help me in this regard.
Thanks in advance.
Code:
struct mylog{
int sno;
time_t time_seconds;
long poscode;
//....
//....
};
Code:
bar=time(&(logdata->time_second));
printf("\n%lu -> %s", logdata->time_second, asctime(gmtime(&(logdata->time_second))));
printf( "%s ",ctime(&bar));
i checked with both ctime & asctime too both are giving wrong date part but correct time part
I checked that value coming in logdata->time_second = 347533824
I guess it should be 10 digits.
Am i correct .
Please help me in this regard.
Thanks in advance.
Comment