diff --git a/handlers/views_handler_field_date.inc b/handlers/views_handler_field_date.inc
index b122b66..ae31205 100644
--- a/handlers/views_handler_field_date.inc
+++ b/handlers/views_handler_field_date.inc
@@ -10,6 +10,7 @@ class views_handler_field_date extends views_handler_field {
 
     $options['date_format'] = array('default' => 'small');
     $options['custom_date_format'] = array('default' => '');
+    $options['query_format'] = array('default' => FALSE);
 
     return $options;
   }
@@ -45,9 +46,61 @@ class views_handler_field_date extends views_handler_field {
       '#dependency' => array('edit-options-date-format' => array('custom', 'raw time ago', 'time ago', 'raw time hence', 'time hence', 'raw time span', 'time span', 'raw time span', 'inverse time span', 'time span')),
     );
 
+    $form['query_format'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use Date Format in query'),
+      '#default_value' => $this->options['query_format'],
+      '#description' => t('Change the SQL query to use the defined date format instead standard unixtime. Not applicable to Time ago, Time hence and Time span formats.'),
+      '#dependency' => array('edit-options-date-format' => array_merge(array_keys($date_formats), array('custom'))),
+    );
+
     parent::options_form($form, $form_state);
   }
 
+  function query() {
+    $this->ensure_my_table();
+
+    $format = '';
+    if ($this->options['query_format']) {
+
+      $date_format_options = $this->options;
+      $date_format = $date_format_options['date_format'];
+      $default_views_formats = array('raw time ago', 'time ago', 'raw time hence', 'time hence', 'raw time span', 'inverse time span', 'time span');
+
+      if (!in_array($date_format, $default_views_formats)) {
+        switch ($date_format) {
+          case 'short':
+            $format = variable_get('date_format_short', 'm/d/Y - H:i');
+            break;
+
+          case 'medium':
+            $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
+            break;
+
+          case 'long':
+            $format = variable_get('date_format_long', 'l, F j, Y - H:i');
+            break;
+
+          case 'custom':
+            $format = $date_format_options['custom_date_format'];
+            break;
+
+          default:
+            $format = variable_get('date_format_' . $date_format, '');
+         }
+      }
+    }
+
+    if ($format === '') {
+      $this->field_alias = $this->query->add_field($this->table_alias, $this->real_field);
+    } else {
+      $sql_date_format = views_date_sql_format($format, $this->table_alias . '.' . $this->real_field);
+      $this->field_alias = $this->query->add_field(NULL, $sql_date_format, $this->table_alias . '_' . $this->real_field);
+    }
+
+    $this->add_additional_fields();
+  }
+
   function render($values) {
     $value = $this->get_value($values);
     $format = $this->options['date_format'];
@@ -74,11 +127,11 @@ class views_handler_field_date extends views_handler_field {
           return t(($time_diff < 0 ? '%time hence' : '%time ago'), array('%time' => format_interval(abs($time_diff), is_numeric($custom_format) ? $custom_format : 2)));
         case 'custom':
           if ($custom_format == 'r') {
-            return format_date($value, $format, $custom_format, null, 'en');
+            return ($this->options['query_format']) ? $value : format_date($value, $format, $custom_format, null, 'en');
           }
-          return format_date($value, $format, $custom_format);
+          return ($this->options['query_format']) ? $value : format_date($value, $format, $custom_format);
         default:
-          return format_date($value, $format);
+          return ($this->options['query_format']) ? $value : format_date($value, $format);
       }
     }
   }
