summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2024-06-12 14:22:07 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2024-06-20 14:36:50 +0200
commit8730575016b15da4892c5adc0d26620688d174bc (patch)
tree84407e8069d005be1a995bab691554f57b83bc69 /include
parent4eb9cde4db28616e0b0c9cd6825830ab7d2f3c96 (diff)
tdf#161469 - Basic: align implementation now with the now function in calc
Align the implementation of the now function in basic with the now function in calc to include the also nanoseconds. The precision is limited to milliseconds to avoid comparision inaccuracies. Change-Id: Ia85b653898f5849f67a171749725faab976b2a8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168706 Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r--include/tools/time.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/tools/time.hxx b/include/tools/time.hxx
index 414b28f72986..6418a50bc23e 100644
--- a/include/tools/time.hxx
+++ b/include/tools/time.hxx
@@ -53,6 +53,7 @@ public:
static const sal_Int64 hourPerDay = 24;
static const sal_Int64 minutePerHour = 60;
static const sal_Int64 secondPerMinute = 60;
+
static const sal_Int64 nanoSecPerSec = 1000000000;
static const sal_Int64 nanoSecPerMinute = nanoSecPerSec * secondPerMinute;
static const sal_Int64 nanoSecPerHour = nanoSecPerSec * secondPerMinute * minutePerHour;
@@ -64,6 +65,12 @@ public:
static const sal_Int64 nanoPerMilli = 1000000;
static const sal_Int64 nanoPerCenti = 10000000;
+ static const sal_Int64 milliSecPerSec = 1000;
+ static const sal_Int64 milliSecPerMinute = milliSecPerSec * secondPerMinute;
+ static const sal_Int64 milliSecPerHour = milliSecPerMinute * minutePerHour;
+ static const sal_Int64 milliSecPerDay = milliSecPerHour * hourPerDay;
+
+
explicit Time( TimeInitEmpty )
{ nTime = 0; }
explicit Time( TimeInitSystem );