Don't get the date of the build from the mail header. It is
often off-by one. Instead extract it from the message body,
namely, when the build was kicked off.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12247 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/auxprogs/nightly-build-summary b/auxprogs/nightly-build-summary
index e98f0e7..ed3cf55 100755
--- a/auxprogs/nightly-build-summary
+++ b/auxprogs/nightly-build-summary
@@ -103,24 +103,13 @@
 
     my %hash = ();
 
-# 1) Get the date from the mail header. This comes first
-    for ($i = 0; $i < $n; ++$i) {
-        $line = $lines[$i];
-
-        if ($line =~ /^Date:/) {
-            $date = (split(/ /, $line))[1];
-            last;
-        }
-    }
-    die "no date found in message $msgno" if ($i == $n);
-
-# 2) Locate the section with the info about the environment of this nightly run
+# 1) Locate the section with the info about the environment of this nightly run
     for ($i = $i + 1; $i < $n; ++$i) {
         last if ($lines[$i] =~ /^valgrind revision:/);
     }
     die "no info block in message $msgno" if ($i == $n);
 
-# 3) Read the info about the build: compiler, valgrind revision etc.
+# 2) Read the info about the build: compiler, valgrind revision etc.
 #    and put it into a hash.
     for ( ; $i < $n; ++$i) {
         $line = $lines[$i];
@@ -137,6 +126,19 @@
         }
     }
 
+# 3) Get the date from when the build was kicked off.
+    for ( ; $i < $n; ++$i) {
+        $line = $lines[$i];
+
+        if ($line =~ /^Started at[ ]+([^ ]+)/) {
+            $date = $1;
+            print "DATE = $date\n";
+            last;
+        }
+    }
+    die "no date found in message $msgno" if ($i == $n);
+
+
 # 4) Find out if the regression run failed or passed
     $hash{"failures"} = [];
     for ($i = $i + 1; $i < $n; ++$i) {