diff --git a/core/includes/common.inc b/core/includes/common.inc
index 9c65647..0c79f0a 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -7316,6 +7316,9 @@ function drupal_parse_info_file($filename) {
     else {
       $data = file_get_contents($filename);
       $info[$filename] = drupal_parse_info_format($data);
+      // Add the info file modification time, so the modules and theme page
+      // can be sorted by the date modules or themes were added or updated.
+      $info[$filename]['mtime'] = filemtime($filename);
     }
   }
   return $info[$filename];
diff --git a/core/modules/simpletest/tests/module.test b/core/modules/simpletest/tests/module.test
index c9601c9..961436d 100644
--- a/core/modules/simpletest/tests/module.test
+++ b/core/modules/simpletest/tests/module.test
@@ -233,6 +233,20 @@ class ModuleUnitTest extends DrupalWebTestCase {
     $poll_before_forum = $poll_position !== FALSE && $forum_position !== FALSE && $poll_position < $forum_position;
     $this->assertTrue($php_before_poll && $poll_before_forum, t('Modules were enabled in the correct order by module_enable().'));
   }
+
+  /**
+   * Tests whether the correct module metadata is returned.
+   */
+  function testMetaData() {
+    // Generate the list of available modules.
+    $files = system_rebuild_module_data();
+    // Check that the mtime field exists for the system module.
+    $this->assertTrue(!empty($files['system']->info['mtime']), 'The system.info file modification time field is present.');
+    // Use 0 if mtime isn't present, to avoid an array index notice.
+    $test_mtime = !empty($files['system']->info['mtime']) ? $files['system']->info['mtime'] : 0;
+    // Ensure the mtime field contains a number that is greater than zero.
+    $this->assertTrue(is_numeric($test_mtime) && ($test_mtime > 0), 'The system.info file modification time field contains a timestamp.');
+  }
 }
 
 /**
