summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-06-09 14:36:07 +0200
committerEike Rathke <erack@redhat.com>2016-06-09 14:37:25 +0200
commit3724a9fa0d923c848d542562637880493cde9ca9 (patch)
treeb035c22dcdd5a85c6e55e9d2fa2a55ae847d27b3 /tools
parent0801e73583fb0b7015d857a481894565c29076a1 (diff)
attempt to document the obscure MAX_DAYS value
Change-Id: I8d8b36e6f61df4a683ce2d32ab0fde8ef003a2e0
Diffstat (limited to 'tools')
-rw-r--r--tools/source/datetime/tdate.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index 8b5cd2ba9dba..78b1ec63ac70 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -29,6 +29,17 @@
static const sal_uInt16 aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31 };
+// The number of days we internally handle.
+// Assuming the first valid positive date in a proleptic Gregorian calendar is
+// 0001-01-01, this results in an end date of 9957-06-26.
+// Hence we documented that years up to and including 9956 are handled.
+/* XXX: it is unclear history why this value was chosen, the representable
+ * 9999-12-31 would be 3652060 days from 0001-01-01. Even 9998-12-31 to
+ * distinguish from a maximum possible date would be 3651695. Better keep the
+ * value in case something somewhere relies on it or there is another reason
+ * beyond..
+ * At least connectivity/source/commontools/dbconversion.cxx has the same
+ * value to calculate with css::util::Date */
#define MAX_DAYS 3636532
namespace