From 925b523388fae09d07b5cdad546e464b44f7d985 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 26 Jun 2018 00:06:20 +0100 Subject: [PATCH] Fix a UTC vs. locaal time calculation error for non-Tx QSY by CAT rigs Doppler correction for mid-point of Tx period when "Settings->General->Allow Tx frequency changes while transmitting" is unchecked was using local time for epheris calculation instead of UTC. --- astro.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/astro.cpp b/astro.cpp index 9829b7159..c0e2b1fe3 100644 --- a/astro.cpp +++ b/astro.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -212,7 +213,7 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const // we do the next period if we calculate just before it starts auto sec_since_epoch = t.toMSecsSinceEpoch () / 1000 + 2; auto target_sec = sec_since_epoch - sec_since_epoch % TR_period + TR_period / 2; - auto target_date_time = QDateTime::fromMSecsSinceEpoch (target_sec * 1000); + auto target_date_time = QDateTime::fromMSecsSinceEpoch (target_sec * 1000, QTimeZone::utc ()); QString date {target_date_time.date().toString("yyyy MMM dd").trimmed ()}; QString utc {target_date_time.time().toString().trimmed ()}; int nyear {target_date_time.date().year()};