For Windows C++, I am trying something like -
unsigned long long int Device::getCurrentUtcTimeinMiliSecond() {
time_t ltime;
time(<ime);
std::tm* newtime = gmtime(<ime);
newtime->tm_hour = 0;
newtime->tm_min = 0;
newtime->tm_sec = 0;
time_t timex = mktime(newtime);
// Want to convert tm* to total miliseconds since Midnight 1970
return (long long)timex * 1000;
}
Is there any other way or am I going in right direction? If yes, then how to convert tm*
to total time millisecond since 1970 Midnight?
Or someone can suggest simpler way of doing it.