basic/source/runtime/methods1.cxx                 |    3 +--
 vbahelper/source/vbahelper/vbaapplicationbase.cxx |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit bc1ab88ffa21ab67dbd56b5d3c724fe28c2b5a5b
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon May 9 18:32:54 2022 +0100
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Tue May 10 06:58:24 2022 +0200

    More usual 1899-12-30 base Date in Basic
    
    Omissions from commit 8189d815641c583b5506d482f0b4f1ab47924f6a
    
    Change-Id: I6b205f7bcc9ff9c30e55b03d39d02b9be15a01c4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134064
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/basic/source/runtime/methods1.cxx 
b/basic/source/runtime/methods1.cxx
index 6ce744dbe034..f0c26ae5a9de 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -3033,9 +3033,8 @@ bool LibreOffice6FloatingPointMode()
 
 sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam, sal_Int16 
nFirstDay )
 {
-    Date aRefDate( 1,1,1900 );
+    Date aRefDate(1899'12'30);
     sal_Int32 nDays = static_cast<sal_Int32>(aDate);
-    nDays -= 2; // normalize: 1.1.1900 => 0
     aRefDate.AddDays( nDays);
     DayOfWeek aDay = aRefDate.GetDayOfWeek();
     sal_Int16 nDay;
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx 
b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index f5624d40bc9f..fe00e0c89739 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -75,9 +75,8 @@ public:
     static double GetNow()
     {
         DateTime aNow( DateTime::SYSTEM );
-        Date aRefDate( 1,1,1900 );
+        Date aRefDate(1899'12'30);
         tools::Long nDiffDays = aNow - aRefDate;
-        nDiffDays += 2; // Change VisualBasic: 1.Jan.1900 == 2
 
         tools::Long nDiffSeconds = aNow.GetHour() * 3600 + aNow.GetMin() * 60 
+ aNow.GetSec();
         return static_cast<double>(nDiffDays) + 
static_cast<double>(nDiffSeconds)/double(24*3600);

Reply via email to