i have this silly code just to see what i get from each struct member
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
time_t mytime;
struct tm *tmp;
mytime = time(NULL);
printf("local time is %s", ctime(&mytime));
if (!(tmp = gmtime(&mytime)))
{
printf("UTC time not available\n");
}
else
{
printf("UTC time is %s", asctime(tmp));
printf("%ld\n", tmp->tm_gmtoff);
printf("hour is %d\n", tmp->tm_hour);
printf("daylight savings is %d\n", tmp->tm_isdst);
printf("day of the month is %d\n", tmp->tm_mday);
printf("minuetes past the hour is %d\n", tmp->tm_min);
printf("month is %d\n", tmp->tm_mon + 1);
printf("seconds = %d\n", tmp->tm_sec);
printf("day of the week is %d\n", tmp->tm_wday);
printf("day of the year is %d\n", tmp->tm_yday);
printf("year is %d\n", tmp->tm_year + 1900);
printf("time zone is %s", tmp->tm_zone);
}
return 0;
}
in general i get what i expected. however daylight saving is 0 which is correct for the answers i get however how do i make it take daylight savings time into account? or is that down to the os?
The other question is what is the tm_gmtoff i just get a value 0.
coop