Index: /trunk/tools/czartool/MySQLDb.pm
===================================================================
--- /trunk/tools/czartool/MySQLDb.pm	(revision 28770)
+++ /trunk/tools/czartool/MySQLDb.pm	(revision 28771)
@@ -65,15 +65,14 @@
 }                                                                               
 
-
 ###########################################################################
 #
-# Returns 'now' as a timestamp
+# Subtracts the provided interval from the provided time
 #
 ###########################################################################
-sub getIntervalInPast {
-    my ($self, $interval) = @_;
+sub subtractInterval {
+    my ($self, $time, $interval) = @_;
 
       my $query = $self->{_db}->prepare(<<SQL);
-          SELECT now() - INTERVAL $interval; 
+          SELECT '$time' - INTERVAL $interval; 
 SQL
     $query->execute;
@@ -82,4 +81,19 @@
 }
 
+###########################################################################
+#
+# Returns whether time1 is before time2
+#
+###########################################################################
+sub isBefore {
+    my ($self, $time1, $time2) = @_;
+
+      my $query = $self->{_db}->prepare(<<SQL);
+          SELECT '$time1' < '$time2'; 
+SQL
+    $query->execute;
+
+return scalar $query->fetchrow_array();
+}
 
 ###########################################################################
