I am trying to output the time of day from the decimal part of the Julian day number but I can't get the calculations right. now.jdn() produces the current Jullian day number. Any help would be appreciated
Thanks
If you think about it, the fractional part of a day is a fraction of 24 hours. So if the fraction of the day is 0.5 that would be 12 hours. So you need to multiply the fraction part of the day with 24 to get hours:
1 2 3 4 5 6
double i, f;
double day = 0.75;
f = modf(day, &i);
double hour = f * 24;
std::cout << int(hour) << '\n';