diff --git a/core/includes/common.inc b/core/includes/common.inc
index a4fcf51..66c570d 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -7315,6 +7315,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..1c79717 100644
--- a/core/modules/simpletest/tests/module.test
+++ b/core/modules/simpletest/tests/module.test
@@ -233,6 +233,22 @@ 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.');
+    // To allow for slow test systems, compare the system.info mtime with the
+    // mtime for this test file. They should not differ by more than an hour.
+    $this_mtime = filemtime(__FILE__);
+    $test_mtime = !empty($files['system']->info['mtime']) ? $files['system']->info['mtime'] : 0;
+    $diff_mtime = abs($this_mtime - $test_mtime);
+    $this->assertTrue($diff_mtime < 3600, 'The system.info file modification time field contains a recent timestamp.');
+  }
 }
 
 /**
