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

New commits:
commit 3828e10f7c3918f89312228739b428dc5046b52e
Author: Wastack <btom...@gmail.com>
Date:   Tue Aug 16 19:25:25 2016 +0200

    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 <lio...@mamane.lu>
    Tested-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx 
b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 007714d..801acd8 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);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to