-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (31 loc) · 740 Bytes
/
main.cpp
File metadata and controls
37 lines (31 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <time.h>
#ifdef _WIN32_WCE
#include <windows.h>
#define main _tmain
time_t time(time_t *inTT) {
SYSTEMTIME sysTimeStruct;
FILETIME fTime;
ULARGE_INTEGER int64time;
time_t locTT = 0;
if (inTT == NULL) {
inTT = &locTT;
}
GetSystemTime(&sysTimeStruct);
if (SystemTimeToFileTime(&sysTimeStruct, &fTime)) {
memcpy(&int64time, &fTime, sizeof(FILETIME));
/* Subtract the value for 1970-01-01 00:00 (UTC) */
int64time.QuadPart -= 0x19db1ded53e8000;
/* Convert to seconds. */
int64time.QuadPart /= 10000000;
*inTT = int64time.QuadPart;
}
return *inTT;
}
#endif
int main(int argc, char **argv)
{
getchar();
return 0;
}