在win2k和xp、2003下读取系统当前的时区,请给出代码

解决方案 »

  1.   

    GetTimeZoneInformation
    The GetTimeZoneInformation function retrieves the current time-zone parameters. These parameters control the translations between Coordinated Universal Time (UTC) and local time. 
      

  2.   

    TIME_ZONE_INFORMATION tzi;
    GetSystemTime(&tzi.StandardDate);
    GetTimeZoneInformation(&tzi); CString strStandName = tzi.StandardName;
    CString strDaylightName = tzi.DaylightName;
    CString strInfo;
    strInfo.Format(_T("%s:时区%d,%s:时差%d小时"),strStandName,tzi.Bias / -60,strDaylightName,tzi.DaylightBias / -60);
    AfxMessageBox(strInfo);
      

  3.   

    这个函数是winAPI的还是MFC的还是标准C的?
    在linux下也有同样的函数吗?
      

  4.   

    GetTimeZoneInformation is WIN32 SDK function.