15,472
社区成员
发帖
与我相关
我的任务
分享
#include <time.h>
#include <stdio.h>
void main()
{
time_t ltime = 1346030160;
char buf[30] = {0};
struct tm *timeptr = localtime(<ime);
strftime(buf,30,"%Y/%m/%d,%H:%M:%S \n" , timeptr);
printf(buf);
}
2012/08/27,09:16:00
Press any key to continue
COleDateTime tmUTC(1346030160L);
COleDateTime tmE8 = tmUTC + COleDateTimeSpan(0, +8, 0, 0);
TRACE(_T("UTC=%s E8=%s\n"),
tmUTC.Format(_T("%y/%m/%d, %H:%M:%S")) ,
tmE8.Format(_T("%y/%m/%d, %H:%M:%S")));