In my C++ windows app I am converting a SYSTEMTIME to a formatted string like so:
SYSTEMTIME systemTime;
GetSystemTime(&systemTime);
char pSystemTime[50];
sprintf_s(pSystemTime, 50, "%04d%02d%02d%02d%02d%02d%03u\0", systemTime.wYear, systemTime.wMonth,
systemTime.wDay, systemTime.wHour,
systemTime.wMinute, systemTime.wSecond,
systemTime.wMilliseconds);
Now I have a time in milliseconds since UNIX epoch.
long time = 1442524186; //for example
How do I convert this long epoch time to a SYSTEMTIME so that I can also format it to a string?