summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--datetime.h5
-rw-r--r--value.cc4
2 files changed, 5 insertions, 4 deletions
diff --git a/datetime.h b/datetime.h
index 371cadbd..c057c76b 100644
--- a/datetime.h
+++ b/datetime.h
@@ -19,9 +19,6 @@ class date_t
{
date_t(const datetime_t& _when);
- protected:
- std::time_t when;
-
public:
static date_t now;
static const char * formats[];
@@ -29,6 +26,8 @@ class date_t
static std::string input_format;
static std::string output_format;
+ std::time_t when;
+
date_t() : when(0) {}
date_t(const date_t& _when) : when(_when.when) {}
diff --git a/value.cc b/value.cc
index 641beb49..1ced0b96 100644
--- a/value.cc
+++ b/value.cc
@@ -1067,7 +1067,9 @@ void value_t::negate()
*((long *) data) = - *((long *) data);
break;
case DATETIME:
- throw new value_error("Cannot negate a date/time");
+ cast(INTEGER);
+ negate();
+ break;
case AMOUNT:
((amount_t *) data)->negate();
break;