VC has what API calculate 1970 years of milliseconds to convert to the current time, such as Java has simpledateformat.format can be a longlong type of value, such as 1306334020009 to May 2011 x days, x, x format.
void Millisecondsince1970tosystemtime (Longlong nmillisecond, SYSTEMTIME *lpsttime)
{
large_integer litime;
Litime.quadpart = Nmillisecond;
First convert to 100 microseconds unit of FILETIME
Litime.quadpart *= 10000;
FILETIME was started in 1960 and needs to be converted with 1970
Litime.quadpart + = 116444736000000000;
Convert to SystemTime
:: FileTimeToSystemTime ((lpfiletime) &litime, lpsttime);
int _tmain (int argc, _tchar* argv[])
{
//Get current time analog input data
longlong nfiletime;
SYSTEMTIME sttime
:: Getlocaltime (&sttime);
:: SystemTimeToFileTime (&sttime, (lpfiletime) & Nfiletime);
Nfiletime-= 116444736000000000;
Nfiletime/= 10000;
Call conversion function
Millisecondsince1970tosystemtime (nfiletime, &sttime);
Output string
::p rintf ("%04d-%02d-%02d%02d:%02d:%02d",
sttime.wyear, Sttime.wmonth, Sttime.wday
, Sttime.whour, Sttime.wminute, sttime.wsecond);
Reference: https://bbs.csdn.net/topics/360244981