[Libreoffice-commits] core.git: connectivity/source

Wastack btomi96 at gmail.com
Fri Jul 15 11:16:12 UTC 2016


 connectivity/source/drivers/firebird/ResultSet.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 88346f606a16865bcf7492f67a7207d0078787a1
Author: Wastack <btomi96 at gmail.com>
Date:   Mon Jul 11 17:25:58 2016 +0200

    tdf#91324 GSoC adapt struct tm correctly
    
    Change-Id: I645ebe888186e550b95dd072e063260bc69aa178
    Reviewed-on: https://gerrit.libreoffice.org/27120
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index bd9179e..f0312c5 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -480,10 +480,14 @@ DateTime OResultSet::retrieveValue(const sal_Int32 nColumnIndex, const ISC_SHORT
         struct tm aCTime;
         isc_decode_timestamp(&aISCTimestamp, &aCTime);
 
-        // first field is nanoseconds -- not supported in firebird or struct tm.
-        // last field denotes UTC (true) or unknown (false)
-        return DateTime(0, aCTime.tm_sec, aCTime.tm_min, aCTime.tm_hour, aCTime.tm_mday,
-                    aCTime.tm_mon, aCTime.tm_year, false);
+        return DateTime(0, //nanoseconds, not supported
+                        aCTime.tm_sec,
+                        aCTime.tm_min,
+                        aCTime.tm_hour,
+                        aCTime.tm_mday,
+                        aCTime.tm_mon + 1, // tm is from 0 to 11
+                        aCTime.tm_year + 1900, //tm_year is the years since 1900
+                        false); // denotes UTC (true), or unknown (false)
     }
     else
     {


More information about the Libreoffice-commits mailing list