diff options
author | Eike Rathke <erack@redhat.com> | 2019-06-12 17:14:10 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-06-19 10:55:20 +0200 |
commit | 869a00f77b5831a67149bc3a4946e21ddba93525 (patch) | |
tree | 332dcfb35adcf10e2c2daba3658e920e45d49e93 /connectivity | |
parent | 2216ca12b2805a6bfcd826d41da79b090b83e0ec (diff) |
Resolves: tdf#125878 correct calculation of H:M:S from timestamp
This apparently has been wrong since the beginning in 2009.
It's a somewhat odd algorithm anyway, first calculating the time
in seconds, minutes and hours, but maybe there's a reason
regarding rounding, so not changing that.
Change-Id: I855d2c96094b4edb1095d20bcdfebdea6d6d943a
Reviewed-on: https://gerrit.libreoffice.org/73893
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
(cherry picked from commit 1436d2307d90f5ddbdcb0f129e59544306530342)
Reviewed-on: https://gerrit.libreoffice.org/73915
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
(cherry picked from commit 5daf494782505dbee27b97a43a79588106715b16)
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 858812193b8f..9e961cf793cb 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -185,8 +185,9 @@ void lcl_CalDate(sal_Int32 _nJulianDate,sal_Int32 _nJulianTime,css::util::DateTi double d_m = d_s / 60.0; double d_h = d_m / 60.0; _rDateTime.Hours = static_cast<sal_uInt16>(d_h); - _rDateTime.Minutes = static_cast<sal_uInt16>(d_m); - _rDateTime.Seconds = static_cast<sal_uInt16>(( d_m - static_cast<double>(_rDateTime.Minutes) ) * 60.0); + _rDateTime.Minutes = static_cast<sal_uInt16>((d_h - static_cast<double>(_rDateTime.Hours)) * 60.0); + _rDateTime.Seconds = static_cast<sal_uInt16>(((d_m - static_cast<double>(_rDateTime.Minutes)) * 60.0) + - (static_cast<double>(_rDateTime.Hours) * 3600.0)); } } |