11 const uint8_t *dataptr =
m_data + 8;
14 uint starttime_no = *(dataptr+2);
15 for (
uint i=0; i < starttime_no; i+=3)
21 dataptr += 3 + starttime_no;
31 uint mjd = (buf[0] << 8) | buf[1];
38 uint secsSince1970 = (mjd - 40587) * 86400;
50 const auto tmpA = (float)(1.0 / 365.25);
51 const auto tmpB = (float)(1.0 / 30.6001);
54 int year = (int) truncf((mjdf - 15078.2F) * tmpA);
55 int month = (int) truncf(
56 (mjdf - 14956.1F - truncf(year * 365.25F)) * tmpB);
57 int day = (int) truncf(
58 (mjdf - 14956.0F - truncf(year * 365.25F) - truncf(month * 30.6001F)));
59 int i = (month == 14 || month == 15) ? 1 : 0;
61 QDate date(1900 + year + i, month - 1 - (i * 12), day);
65 #if QT_VERSION < QT_VERSION_CHECK(6,5,0)
66 return {date, time, Qt::UTC};
68 return {date, time, QTimeZone(QTimeZone::UTC)};