其他分享
首页 > 其他分享> > WinCE UTC时间转为本地时间的方法

WinCE UTC时间转为本地时间的方法

作者:互联网

SYSTEMTIME stime;
stime.wYear = WORD(m_GpsInfo.GPRMCInfo.UTCDate%100+2000);
stime.wMonth = WORD(m_GpsInfo.GPRMCInfo.UTCDate/100%100);
stime.wDay = WORD(m_GpsInfo.GPRMCInfo.UTCDate/10000);
stime.wHour = WORD(m_GpsInfo.GPRMCInfo.UTC/10000);
stime.wMinute = WORD(m_GpsInfo.GPRMCInfo.UTC/100%100);
stime.wSecond = WORD(m_GpsInfo.GPRMCInfo.UTC%100);

FILETIME ftime;
SystemTimeToFileTime(&stime,&ftime);

FILETIME flocaltime;
FileTimeToLocalFileTime(&ftime,&flocaltime);
FileTimeToSystemTime(&flocaltime,&stime);

 

标签:UTC,WORD,GpsInfo,时间,stime,WinCE,GPRMCInfo,ftime,100
来源: https://blog.51cto.com/u_15298588/3034205