18 #if defined(__WIN32__) || defined(__UNIX__)
19 #include <sys/timeb.h>
25 using namespace basis;
44 os_time.wYear = WORD(new_time.
year);
45 os_time.wMonth = new_time.
month;
48 os_time.wHour = new_time.
hour;
49 os_time.wMinute = new_time.
minute;
50 os_time.wSecond = new_time.
second;
51 os_time.wMilliseconds = 0;
55 OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES
56 | TOKEN_QUERY, &petoken);
61 LookupPrivilegeValue(NULL, to_unicode_temp(
"SeSystemTimePrivilege"), &our_id);
63 TOKEN_PRIVILEGES privs;
64 privs.PrivilegeCount = 1;
65 privs.Privileges[0].Luid = our_id;
66 privs.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
68 AdjustTokenPrivileges(petoken,
false, &privs,
sizeof(TOKEN_PRIVILEGES),
71 SetLocalTime(&os_time);
74 AdjustTokenPrivileges(petoken,
true, &privs,
sizeof(TOKEN_PRIVILEGES),
79 ::PostMessage(HWND_BROADCAST, WM_TIMECHANGE, 0, 0);
85 #elif defined(__UNIX__)
90 return ted.
year ? 0:1;
time_number minute
The number of minutes after the hour.
time_number second
The number of seconds after the current minute.
time_number hour
The hour represented in military time: 0 through 23.
time_number day_of_year
Numerical day, where January 1st is equal to zero.
days day_of_week
The day of the week.
months month
The current month.
An object that represents a particular point in time.
time_number year
The year, using the gregorian calendar.
The guards collection helps in testing preconditions and reporting errors.
unsigned int un_int
Abbreviated name for unsigned integers.
A dynamic container class that holds any kind of object via pointers.
Support for unicode builds.
Aids in achievement of platform independence.