Pick the correct timezoneoffset for the day in question

Calculating the timezoneoffset for the current date really makes no sense
whatsoever when displaying a time that isn't "now".

Fixes #605

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-07-16 20:23:15 -07:00
parent bebcbfe92a
commit b3e662a895
3 changed files with 9 additions and 5 deletions

View file

@ -380,7 +380,7 @@ void MainTab::updateDiveInfo(bool clear)
if (!clear) {
updateGpsCoordinates(&displayed_dive);
QDateTime localTime = QDateTime::fromTime_t(displayed_dive.when - gettimezoneoffset());
QDateTime localTime = QDateTime::fromTime_t(displayed_dive.when - gettimezoneoffset(displayed_dive.when));
ui.dateEdit->setDate(localTime.date());
ui.timeEdit->setTime(localTime.time());
if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) {