diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index f180cbd..d1a03b4 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -553,6 +553,11 @@ function template_preprocess_datetime_form(&$variables) {
     $variables['attributes']['class'] = (array) $element['#attributes']['class'];
   }
 
+  // Unset #prefix and #suffix here to avoid duplicate, since they already are
+  // in datetime_wrapper.
+  unset($element['#prefix']);
+  unset($element['#suffix']);
+
   $variables['content'] = $element;
 }
 
diff --git a/core/modules/system/tests/modules/form_test/form_test.routing.yml b/core/modules/system/tests/modules/form_test/form_test.routing.yml
index 2250a0b..ced5068 100644
--- a/core/modules/system/tests/modules/form_test/form_test.routing.yml
+++ b/core/modules/system/tests/modules/form_test/form_test.routing.yml
@@ -409,6 +409,14 @@ form_test.button_class:
   requirements:
     _access: 'TRUE'
 
+form_test.date_attributes:
+  path: '/form-test/date-attributes'
+  defaults:
+    _form: '\Drupal\form_test\Form\FormTestDateAttributesForm'
+    _title: 'Date attributes testing'
+  requirements:
+    _access: 'TRUE'
+
 form_test.details_form:
   path: '/form_test/details-form'
   defaults:
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestDateAttributesForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestDateAttributesForm.php
new file mode 100644
index 0000000..5059628
--- /dev/null
+++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestDateAttributesForm.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace Drupal\form_test\Form;
+
+use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Builds a simple form to test form date attributes.
+ */
+class FormTestDateAttributesForm extends FormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'form_test_date_attributes';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $form['date'] = [
+      '#type' => 'date',
+      '#default_value' => date('Y-m-d'),
+      '#prefix' => 'this is a date prefix',
+      '#suffix' => 'this is a date suffix',
+    ];
+
+    $form['datetime'] = [
+      '#type' => 'datetime',
+      '#default_value' => date('Y-m-d'),
+      '#prefix' => 'this is a datetime prefix',
+      '#suffix' => 'this is a datetime suffix',
+    ];
+
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+  }
+
+}
diff --git a/core/modules/system/tests/src/Functional/DateTest.php b/core/modules/system/tests/src/Functional/DateTest.php
new file mode 100644
index 0000000..f46210b
--- /dev/null
+++ b/core/modules/system/tests/src/Functional/DateTest.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Drupal\Tests\system\Functional;
+
+use Drupal\Core\Url;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests rendering and behavior of date FAPI element.
+ *
+ * @group system
+ */
+class DateTest extends BrowserTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['system', 'form_test'];
+
+  /**
+   * Tests that #prefix and #suffix are rendered onces only.
+   */
+  public function testPrefixSuffixRenderingOnDateElement() {
+    $html = $this->drupalGet(Url::fromRoute('form_test.date_attributes'));
+    // Check that prefix renders only once on date element.
+    $this->assertEquals(1, substr_count($html, 'this is a date prefix'));
+    // Check that prefix renders only once on date element.
+    $this->assertEquals(1, substr_count($html, 'this is a date suffix'));
+    // Check that prefix renders only once on datetime element.
+    $this->assertEquals(1, substr_count($html, 'this is a datetime prefix'));
+    // Check that prefix renders only once on datetime element.
+    $this->assertEquals(1, substr_count($html, 'this is a datetime suffix'));
+  }
+}
