summaryrefslogtreecommitdiff
path: root/value.cc
diff options
context:
space:
mode:
Diffstat (limited to 'value.cc')
-rw-r--r--value.cc4
1 files changed, 3 insertions, 1 deletions
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;