Code: Select all
long GetLocalUTC()
{
//Insert the code starting here
time_t utc;
struct tm utc_tm, local_tm;
utc = time(&utc);//freeze on this func call
//MessageBox(NULL,"3","",MB_OK);
memcpy(&utc_tm, gmtime(&utc), sizeof(struct tm));
memcpy(&local_tm, localtime(&utc), sizeof(struct tm));
utc = utc + ((local_tm.tm_hour - utc_tm.tm_hour) * 3600);
return utc;
}