Получилось что-то вроде такого вот:
char* dateTime[22];
DYNAMIC_TIME_ZONE_INFORMATION tz;
SYSTEMTIME time;
GetLocalTime(&time);
GetDynamicTimeZoneInformation(&tz);
char timeZone[7];
if(tz.Bias==0)
strcpy(timeZone, "Z");
else
{
char symbol=(tz.Bias>0)?('-'):('+');
u_int tzHours = floor((long double)(abs(tz.Bias)/60));
u_int tzMinutes = abs(tz.Bias)%60;
sprintf(timeZone, "%c%02u:%02u", symbol, tzHours, tzMinutes);
}
char timeStamp[22];
sprintf(timeStamp, "%04i-%02i-%02iT%02i:%02i:%02i%s", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond, timeZone);