summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc
index d39597bd..54a6038f 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -907,6 +907,9 @@ void value_t::in_place_cast(type_t cast_type)
case DATE:
switch (cast_type) {
+ case DATETIME:
+ set_datetime(datetime_t(as_date(), time_duration(0, 0, 0, 0)));
+ return;
case STRING:
set_string(format_date(as_date(), string("%Y-%m-%d")));
return;
@@ -916,6 +919,9 @@ void value_t::in_place_cast(type_t cast_type)
break;
case DATETIME:
switch (cast_type) {
+ case DATE:
+ set_date(as_datetime().date());
+ return;
case STRING:
set_string(format_datetime(as_datetime(), string("%Y-%m-%d %H:%M:%S")));
return;