summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorWastack <btomi96@gmail.com>2016-08-16 19:25:25 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2016-08-17 13:15:31 +0000
commit3828e10f7c3918f89312228739b428dc5046b52e (patch)
tree631b16ff64b29326fbe2c26efacaa6ac347325c6 /connectivity
parentd3a510e6ec7a42a7a30a24b7373931b8a8ef1a54 (diff)
tdf#91324 correct firebird date format
Store date inside the embedded firebird database as: Years as the years since 1900. Months from 0 to 11. Change-Id: Ic6269a183261c4c482f91f0d3871b42c54d4b99f Reviewed-on: https://gerrit.libreoffice.org/28173 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/PreparedStatement.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 007714da0c5c..801acd8ae29f 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -391,8 +391,8 @@ void SAL_CALL OPreparedStatement::setDate(sal_Int32 nIndex, const Date& rDate)
{
struct tm aCTime;
aCTime.tm_mday = rDate.Day;
- aCTime.tm_mon = rDate.Month;
- aCTime.tm_year = rDate.Year;
+ aCTime.tm_mon = rDate.Month -1;
+ aCTime.tm_year = rDate.Year -1900;
ISC_DATE aISCDate;
isc_encode_sql_date(&aCTime, &aISCDate);
@@ -422,8 +422,8 @@ void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 nIndex, const DateTime&
aCTime.tm_min = rTimestamp.Minutes;
aCTime.tm_hour = rTimestamp.Hours;
aCTime.tm_mday = rTimestamp.Day;
- aCTime.tm_mon = rTimestamp.Month;
- aCTime.tm_year = rTimestamp.Year;
+ aCTime.tm_mon = rTimestamp.Month - 1;
+ aCTime.tm_year = rTimestamp.Year - 1900;
ISC_TIMESTAMP aISCTimestamp;
isc_encode_timestamp(&aCTime, &aISCTimestamp);