# date
Mon Jun 24 10:26:04 CST 2019
# date -u
Mon Jun 24 11:23:08 UTC 2019
只删除/etc/localtime文件就可以了
ln
-sf
/usr/share/zoneinfo/Asia/Shanghai
/etc/localtime
ntpdate cn.pool.ntp.org #对时
GetTimeZone(&timeZone, &tz_min);
//东八区 timeZone=8
if(timeZone >= 0)
{
tSecond += ( timeZone * 3600 + tz_min*60);
}
TimeUtcToHuman( tSecond, &year, &month, &day, &hour, &minute, &second )
{
struct timeval tv;
struct tm tm;
tv.tv_sec = utc;
tv.tv_usec = 0;
localtime_r( &tv.tv_sec, &tm );
*year = tm.tm_year + 1900;
*month = tm.tm_mon + 1;
*day = tm.tm_mday;
*hour = tm.tm_hour;
*minute = tm.tm_min;
*second = tm.tm_sec;
}