наваял:
string gmt_to_local( int year, int mon, int day, int hour, int min, int sec ){
struct timeval tv;
struct tm* ptm;
char time_string[40] = {0};
string result;
time_t tmt;
long tzone;
int timezone_hours, is_dst;
extern time_t timezone;
is_dst = 0;
gettimeofday(&tv, NULL);
ptm = localtime(&tv.tv_sec);
is_dst = ptm->tm_isdst;
tzone = (-1) * timezone;
timezone_hours = tzone / 3600;
timezone_hours += is_dst;
ptm->tm_year = year - 1900;
ptm->tm_mon = mon -1;
ptm->tm_mday = day;
ptm->tm_hour = hour + timezone_hours;
ptm->tm_min = min;
ptm->tm_sec = sec;
tmt = mktime( ptm );
ptm = localtime( &tmt );
strftime( time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", ptm );
result = time_string;
return ( result );
}