How recieve time from system time
-
Hello! I have a digitals that contain a local time (1387475976). How I can recieve the correctly filled SYSTEMTIME struct? I try to use next code, but it is wrong: __int64 ull(1387475976); FILETIME lpFileTime; SYSTEMTIME SystemTime; memcpy(&lpFileTime, &ull, sizeof(__int64)); FileTimeToSystemTime(&lpFileTime, &SystemTime); cout << SystemTime.wYear << endl; In out SystemTime.wYear = 1601 :confused: Thanks, Andrey
-
Hello! I have a digitals that contain a local time (1387475976). How I can recieve the correctly filled SYSTEMTIME struct? I try to use next code, but it is wrong: __int64 ull(1387475976); FILETIME lpFileTime; SYSTEMTIME SystemTime; memcpy(&lpFileTime, &ull, sizeof(__int64)); FileTimeToSystemTime(&lpFileTime, &SystemTime); cout << SystemTime.wYear << endl; In out SystemTime.wYear = 1601 :confused: Thanks, Andrey
myshketer wrote:
I have a digitals that contain a local time (1387475976).
Does this represent the number of 100-nanosecond intervals since 1-January-1601?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
myshketer wrote:
I have a digitals that contain a local time (1387475976).
Does this represent the number of 100-nanosecond intervals since 1-January-1601?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hello! I have a digitals that contain a local time (1387475976). How I can recieve the correctly filled SYSTEMTIME struct? I try to use next code, but it is wrong: __int64 ull(1387475976); FILETIME lpFileTime; SYSTEMTIME SystemTime; memcpy(&lpFileTime, &ull, sizeof(__int64)); FileTimeToSystemTime(&lpFileTime, &SystemTime); cout << SystemTime.wYear << endl; In out SystemTime.wYear = 1601 :confused: Thanks, Andrey
-
That all depends on what you mean by "too small." Since there are 36,000,000,000 100-nanosecond intervals per hour, the value 1,387,475,976 is still within January 1st, 1601. Make sense?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne