#include <ctime> 
#include <iostream>

const unsigned int SECONDS_PER_MINUTE(60);
const unsigned int SECONDS_PER_HOUR(3600);

unsigned int getSecondsSinceUTCMidnight()
{
   unsigned int secondsSinceMidnight;

   time_t currentUTCTimeMoment;
   tm*    currentUTCTimeMomentInStructure;

   time(&currentUTCTimeMoment);

   currentUTCTimeMomentInStructure = gmtime(&currentUTCTimeMoment);

   secondsSinceMidnight  = currentUTCTimeMomentInStructure->tm_sec;
   secondsSinceMidnight += currentUTCTimeMomentInStructure->tm_min  * SECONDS_PER_MINUTE;
   secondsSinceMidnight += currentUTCTimeMomentInStructure->tm_hour * SECONDS_PER_HOUR;

   return secondsSinceMidnight;
}

double secondsToDouble(const unsigned int count)
{
   return (static_cast<double>(count) / static_cast<double>(SECONDS_PER_HOUR));
}

int main()
{
   const auto secondCount(getSecondsSinceUTCMidnight());
   const auto timeInHours(secondsToDouble(secondCount));

   std::cout << timeInHours << std::endl;

   return 0;
}

