diff --git a/core/modules/system/templates/time.html.twig b/core/modules/system/templates/time.html.twig
index dee5b9b839410be7884fdfa1b8883898038d1ce3..c99d565d6eb3ba5414664cea259eadc0577edce3 100644
--- a/core/modules/system/templates/time.html.twig
+++ b/core/modules/system/templates/time.html.twig
@@ -19,4 +19,10 @@
  * @see https://www.w3.org/TR/html5-author/the-time-element.html#attr-time-datetime
  */
 #}
+
+{% if text matches '/^\\d+$/' %}
+{{ text }}
+{% else %}
 <time{{ attributes }}>{{ text }}</time>
+{% endif %}
+
diff --git a/core/modules/views/src/Plugin/views/field/Date.php b/core/modules/views/src/Plugin/views/field/Date.php
index 16ab35075df324913f303ca00655cf29bb9c2464..bffe054214e730a838b3ceb9ce5a9f6dcad9782a 100644
--- a/core/modules/views/src/Plugin/views/field/Date.php
+++ b/core/modules/views/src/Plugin/views/field/Date.php
@@ -185,6 +185,9 @@ public function render(ResultRow $values) {
           if ($custom_format == 'r') {
             return $this->dateFormatter->format($value, $format, $custom_format, $timezone, 'en');
           }
+          if ($custom_format == 'U') {
+            return $value;
+          }
           return $this->dateFormatter->format($value, $format, $custom_format, $timezone);
 
         default: