#include <windows.h>
#include <sys/time.h>
void getSystemTime() {
SYSTEMTIME sys;
GetLocalTime(&sys);
printf("%4d/%02d/%02d %02d:%02d:%02d.%03d 星期%1d\n", sys.wYear, sys.wMonth, sys.wDay, sys.wHour, sys.wMinute,
sys.wSecond, sys.wMilliseconds, sys.wDayOfWeek);
}
long getCurrentTime() {
struct timeval tv;
gettimeofday(&tv, NULL);
getSystemTime();
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
2017/09/20 13:44:39.052 星期3