Dive model: use the correct time to set the time zone offset

We need to calculate the offset based on the time of the dive - the mobile
version doesn't use displayed_dive. This way time stamps are now correct
all year round.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-12-08 06:20:51 -08:00
parent 8baae6a3b6
commit 729ac7619e

View file

@ -203,7 +203,7 @@ void Dive::put_divemaster()
void Dive::put_date_time()
{
QDateTime localTime = QDateTime::fromTime_t(dive->when - gettimezoneoffset(displayed_dive.when));
QDateTime localTime = QDateTime::fromTime_t(dive->when - gettimezoneoffset(dive->when));
localTime.setTimeSpec(Qt::UTC);
m_date = localTime.date().toString(prefs.date_format);
m_time = localTime.time().toString(prefs.time_format);