Permalink
Browse files

narcissus: don't use fancy-schmancy PHP 5.3 features for date calcula…

…tions

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
  • Loading branch information...
1 parent b75e9be commit c483713d244808b5f38c1a44bfd92ea8b1372d58 @koenkooi koenkooi committed Nov 25, 2010
Showing with 3 additions and 6 deletions.
  1. +3 −6 stats.php
View
@@ -23,11 +23,9 @@
while ($stats = fscanf($handle, "%s %s\n")) {
list ($timestamp, $machine) = $stats;
if(isset($startdate)) {
- $enddate = date_create();
- date_timestamp_set($enddate, $timestamp);
+ $enddate = $timestamp;
} else {
- $startdate = $date = date_create();
- date_timestamp_set($startdate, $timestamp);
+ $startdate = $timestamp;
}
if (isset($buildcount[$machine])) {
$buildcount[$machine] = $buildcount[$machine] +1 ;
@@ -38,8 +36,7 @@
}
fclose ($handle);
-$interval = $startdate->diff($enddate);
-$intervaldays = $interval->format('%a');
+$intervaldays = round(($enddate - $startdate) / (60 * 60 * 24),1);
arsort($buildcount);

0 comments on commit c483713

Please sign in to comment.