summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorWastack <btomi96@gmail.com>2016-07-11 17:25:58 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2016-07-15 11:15:49 +0000
commit88346f606a16865bcf7492f67a7207d0078787a1 (patch)
tree6cd9b711c84ed8d36bf5dd84c6067cea66fef264 /connectivity
parent8be8152bcb7327d046049dee640ca438deaa4dad (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>
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 bd9179e23149..f0312c51f3fc 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
{