How to access GMT time using VC
In my project i am using GetLocalTime() and GetSystemTime and set the current time into registry. But my problem is when i am changing the开发者_如何学Go time of my machine the changed time only saving to registry. Is there any chance to access the GMT time so that its independent of machine and nobody can change the time..
Please give some help
How to access GMT time using VC
// you mentioned it
#include <Windows.h>
SYSTEMTIME gmtTime;
ZeroMemory(&gmtTime,sizeof(gmtTime));
GetSystemTime(&gmtTime);
This function is using your machine's hardware time. If you want a time that's independent of your machine, then you may want to use NTP or SNTP
精彩评论