summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorWastack <btomi96@gmail.com>2016-07-11 17:25:58 +0200
committerAndras Timar <andras.timar@collabora.com>2016-07-18 11:18:59 +0200
commit379c847556b6bcdd768d46469dfd8fc05cdef317 (patch)
treeadd1cc386e9c750de2ae25bae40c33b4f9fd3f8c /connectivity
parent7f50a2253fec328b6bd2dbdae8be6c2d4dc9928f (diff)
tdf#91324 GSoC adapt struct tm correctly
Change-Id: I645ebe888186e550b95dd072e063260bc69aa178 Reviewed-on: https://gerrit.libreoffice.org/27120 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Lionel Elie Mamane <lionel@mamane.lu> (cherry picked from commit 88346f606a16865bcf7492f67a7207d0078787a1) Reviewed-on: https://gerrit.libreoffice.org/27235 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit f9393f84d539814574b594e173367335fe0c42e8)
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/ResultSet.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index 764f561c245d..7de2a46fd455 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
{