diff --git a/includes/common.inc b/includes/common.inc
index 5f7cdb8..f343ec3 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -6438,6 +6438,9 @@ function drupal_common_theme() {
       'render element' => 'elements',
       'template' => 'region',
     ),
+    'time' => array(
+      'variables' => array('timestamp' => NULL, 'text' => NULL, 'format_options' => array(), 'gmdate_format' => 'Y-m-d\TH:i:s\Z', 'attributes' => array(), 'path' => NULL),
+    ),
     'status_messages' => array(
       'variables' => array('display' => NULL),
     ),
diff --git a/includes/theme.inc b/includes/theme.inc
index bea87c0..94b7f5b 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -1447,6 +1447,45 @@ function theme_disable($theme_list) {
  */
 
 /**
+ * Returns HTML for a date / time.
+ *
+ * @param $variables
+ *   An associative array containing:
+ *   - timestamp: (optional) The UNIX timestamp for the time. If not provided,
+ *     REQUEST_TIME will be used.
+ *   - text: (optional) The text to display in the <time> element. This will
+ *     default to a formatted date of the datetime attribute value.
+ *   - format_options: (optional) Used to format the text content if the text
+ *     variable is not passed in.
+ *     @see format_date()
+ *   - gmdate_format: (optional) The format for the value of the datetime
+ *     attribute. Defaults to 'Y-m-d\TH:i:s\Z'. The Z signifies that the
+ *     datetime value will be given in UTC instead of the local time with a
+ *     timezone offset.
+ *     @see http://www.php.net/manual/en/function.gmdate.php
+ *   - attributes: (optional) Associative array of attributes to be placed in
+ *     the time tag.
+ *     @see http://www.w3.org/TR/html5/text-level-semantics.html#the-time-element
+ *   - path: (optional) A string that contains a URL or URL fragment to pass
+ *     to the l() function to render the time element text as a link.
+ *
+ * @see template_preprocess_time
+ */
+function theme_time($variables) {
+  $output = '<time' . drupal_attributes($variables['attributes']) . '>';
+  // Wrap the human readable label in a link if a path is provided.
+  if (!empty($variables['path'])) {
+    $output .= l($variables['text'], $variables['path']);
+  }
+  else {
+    $output .= $variables['text'];
+  }
+  $output .= '</time>';
+
+  return $output;
+}
+
+/**
  * Returns HTML for status and/or error messages, grouped by type.
  *
  * An invisible heading identifies the messages for assistive technology.
@@ -2563,6 +2602,32 @@ function theme_get_suggestions($args, $base, $delimiter = '__') {
 }
 
 /**
+ * Preprocess variables for theme_time().
+ */
+function template_preprocess_time(&$variables) {
+  // If there isn't a datetime attribute already set, format the datetime
+  // attribute with gmdate().
+  if (empty($variables['attributes']['datetime'])) {
+    // Get the timestamp. If none exists, assume REQUEST_TIME;
+    if (empty($variables['timestamp'])) {
+      $variables['timestamp'] = REQUEST_TIME;
+    }
+    $variables['attributes']['datetime'] = gmdate($variables['gmdate_format'], $variables['timestamp']);
+  }
+
+  // If no text for the <time> element was provided, print a human readable
+  // version of the datetime attribute.
+  if (empty($variables['text'])) {
+    $type = isset($variables['format_options']['type']) ? $variables['format_options']['type'] : '';
+    $format = isset($variables['format_options']['format']) ? $variables['format_options']['format'] : '';
+    $timezone = isset($variables['format_options']['timezone']) ? $variables['format_options']['timezone'] : NULL;
+    $langcode = isset($variables['format_options']['langcode']) ? $variables['format_options']['langcode'] : NULL;
+
+    $variables['text'] = format_date($variables['timestamp'], $type, $format, $timezone, $langcode);
+  }
+}
+
+/**
  * The variables array generated here is a mirror of template_preprocess_page().
  * This preprocessor will run its course when theme_maintenance_page() is
  * invoked.
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index 7c68989..9334af7 100644
--- a/modules/simpletest/tests/theme.test
+++ b/modules/simpletest/tests/theme.test
@@ -451,3 +451,52 @@ class ThemeHtmlTag extends DrupalUnitTestCase {
     $this->assertEqual('<title>title test</title>'."\n", theme_html_tag($tag), t('Test title tag generation.'));
   }
 }
+
+/**
+ * Unit tests for theme_time().
+ */
+class ThemeTime extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Theme HTML time tag',
+      'description' => 'Tests the theme_time() theme function.',
+      'group' => 'Theme',
+    );
+  }
+
+  /**
+   * Test function theme_time().
+   */
+  function testThemeTime() {
+    // Test the server's timezone
+    $timestamp = 280281600;
+    $variables = array(
+      'timestamp' => $timestamp,
+    );
+    // format_date is called because the display of the timestamp will depend
+    // on the timezone of the server that runs this function.
+    $date = format_date($timestamp);
+    $this->assertEqual('<time datetime="1978-11-19T00:00:00Z">' . $date . '</time>', theme('time', $variables), 'Test a basic invocation of theme_time with just a timestamp.');
+
+    // Test a specific timezone - Europe/Brussels
+    $timestamp = 280281600;
+    $variables = array(
+      'timestamp' => $timestamp,
+      'format_options' => array(
+        'timezone' => 'Europe/Brussels',
+      ),
+    );
+    $this->assertEqual('<time datetime="1978-11-19T00:00:00Z">Sun, 11/19/1978 - 01:00</time>', theme('time', $variables), 'Test theme_time with a timestamp and the timezone Europe/Brussels.');
+
+    // Test wrapping the time text in a link.
+    $timestamp = 280281600;
+    $variables = array(
+      'timestamp' => $timestamp,
+      'format_options' => array(
+        'timezone' => 'Europe/Brussels',
+      ),
+      'path' => 'http://buytaert.net/',
+    );
+    $this->assertEqual('<time datetime="1978-11-19T00:00:00Z"><a href="http://buytaert.net/">Sun, 11/19/1978 - 01:00</a></time>', theme('time', $variables), 'Test theme_time with a timestamp, the timezone Europe/Brussels and a link.');
+  }
+}
