mktime problem
I am using mktime function to convert time from UTC to local time.
All is going well until the year changes. Apparently mktime convert the year to the system current year and not year passed in the time_t struct.
For example if i input the year of 2008 it will return the year 2007.
I am using the following code:
[code]
time_t ltime;
ltime = time(NULL);
newtime = localtime(<ime);
newtime->tm_mday = atoi(year) - 1900;
newtime->tm_mday = atoi(day);
newtime->tm_mon= atoi(month)-1;
newtime->tm_hour = atoi(hour);
newtime->tm_min= atoi(min);
newtime->tm_sec= 0;
newtime->tm_isdst = 0;
ltime = mktime(newtime);
strftime(buf ,15 , "%Y%m%d%H%M",newtime);
[/code]
Can someone tell me how solve this problem? or an alternative form to convert dates from UTC to local time.
Thanks in advance.

