Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
It turned out something like this:
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);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question